wowzer
This commit is contained in:
parent
0fef98efaf
commit
d1b04c13d1
5 changed files with 31 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,2 +1,4 @@
|
||||||
/target
|
/target
|
||||||
.direnv/
|
.direnv/
|
||||||
|
blog.html
|
||||||
|
result.html
|
||||||
|
|
|
||||||
4
blog.md
Normal file
4
blog.md
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
## My Blogpost 1 - wholesome
|
||||||
|
wuhp
|
||||||
|
## My blogpost 2 - sadge
|
||||||
|
bubglub
|
||||||
3
run.sh
Executable file
3
run.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#/bin/sh
|
||||||
|
cargo run "$@" > blog.html
|
||||||
|
sed template.html -e '/INSERT_HERE/r blog.html' > result.html
|
||||||
11
src/main.rs
11
src/main.rs
|
|
@ -1,3 +1,12 @@
|
||||||
|
use std::fs::read;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
// arg 1: src, arg 2: dest
|
||||||
|
let args: Vec<String> = std::env::args().collect();
|
||||||
|
let input: String = std::fs::read_to_string(&args[1]).unwrap();
|
||||||
|
let mut output = input;
|
||||||
|
|
||||||
|
// headings: replace # - newline to <h1> - </h1>
|
||||||
|
|
||||||
|
println!("{}", output);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
template.html
Normal file
12
template.html
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en-US">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
|
<title>MDF BLOG</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>MDF BLOG 🍼</p>
|
||||||
|
INSERT_HERE
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue