diff --git a/.gitignore b/.gitignore index 0e71e34..74b4ad3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /target .direnv/ +blog.html +result.html diff --git a/blog.md b/blog.md new file mode 100644 index 0000000..e0b34cd --- /dev/null +++ b/blog.md @@ -0,0 +1,4 @@ +## My Blogpost 1 - wholesome +wuhp +## My blogpost 2 - sadge +bubglub diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..11e8a45 --- /dev/null +++ b/run.sh @@ -0,0 +1,3 @@ +#/bin/sh +cargo run "$@" > blog.html +sed template.html -e '/INSERT_HERE/r blog.html' > result.html diff --git a/src/main.rs b/src/main.rs index e7a11a9..25b86a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,12 @@ +use std::fs::read; + fn main() { - println!("Hello, world!"); + // arg 1: src, arg 2: dest + let args: Vec = std::env::args().collect(); + let input: String = std::fs::read_to_string(&args[1]).unwrap(); + let mut output = input; + + // headings: replace # - newline to

-

+ + println!("{}", output); } diff --git a/template.html b/template.html new file mode 100644 index 0000000..db8e041 --- /dev/null +++ b/template.html @@ -0,0 +1,12 @@ + + + + + MDF BLOG + + +

MDF BLOG 🍼

+ INSERT_HERE + + +