From af10bc25a483d7e9d16e05246f1f8df1b1422aeb Mon Sep 17 00:00:00 2001
From: viridian <viridian@noreply.localhost>
Date: Wed, 10 Apr 2024 18:50:17 +0200
Subject: [PATCH] Create usage docs WIP

---
 Using-mlem.md | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 Using-mlem.md

diff --git a/Using-mlem.md b/Using-mlem.md
new file mode 100644
index 0000000..7bd8a8a
--- /dev/null
+++ b/Using-mlem.md
@@ -0,0 +1,43 @@
+# Using mlem
+Some prerequisites before you can use mlem are: 
+- A Rust Compiler
+- Knowledge of HTML
+- Knowledge of Markdown
+
+## Writing a config
+
+Mlem expects a `mlem.toml` in its execution directory to work. You can generate the config by running `mlem create` . The default config file it creates looks like this:
+
+```toml
+output_dir = "output"
+src_dir = "md_src"
+templates_dir = "templates"
+```
+You can change all these values later as well.
+
+## Creating a template
+
+### Blog template
+
+Before you can even write anything you will have to add some templates into the `templates` directory (assuming your using the default). These templates are made using [Tera][1] reading the documentation should be enough to write a template for a blog post. 
+The values which mlem exposes to the blog template are:
+
+-  `blog_content` This contains the HTML of the markdown of the post 
+-   The values defined in the frontmatter
+
+### Index template
+
+The index template will be used to generate an index of all posts. **It must be named `index.html`**. The values exposed to this template are:
+
+- `blog_posts` An array of structs containing the posts.
+    - title
+    - human_date
+    - sort_date
+    - content
+    - output_file_name
+- `truncate` [filter][2]; works like a call to String.truncate()
+
+//TODO
+
+[1]: https://keats.github.io/tera/docs/
+[2]: https://keats.github.io/tera/docs/#filters
\ No newline at end of file