aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-01-11 18:18:48 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-01-11 18:18:48 +0100
commitd3c3ae47a2937bf0ace994a4bc9928cd2f3605de (patch)
treef13e8c98e973b9c6534c477c3f2829e87e23d0dc /README.md
parent82b803603f519bcd91eb4a2fbc9bb5c2bfa6e168 (diff)
downloadtemper-d3c3ae47a2937bf0ace994a4bc9928cd2f3605de.tar.gz
temper-d3c3ae47a2937bf0ace994a4bc9928cd2f3605de.tar.bz2
temper-d3c3ae47a2937bf0ace994a4bc9928cd2f3605de.zip
Added make-index builtin
Diffstat (limited to 'README.md')
-rw-r--r--README.md41
1 files changed, 38 insertions, 3 deletions
diff --git a/README.md b/README.md
index b317020..c8feed5 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,51 @@
# temper
-Common Listp templating language.
+Common Listp templating engine inspired by [ejs](https://ejs.co/).
## Usage
+### From the command line
+
+```command
+$ ./temper.lisp template.lisp.html > generated.html
+```
+
+```command
+$ ./temper.lisp template_directory
+```
+
+### In the template
+
+You can put any Common lisp code between `<%` and `%>`.
+Put the result of a form in the template with `<%=`.
+
```html
-<% (loop :for i in '(1 2 3)) %>
+<ul>
+ <% (dotimes (_ 10)) %>
<li> <%= i %> </li>
-<% ) %>
+ <% ) %>
+</ul>
+```
+
+Use the `render` function to include a template in another.
+
+```html
+<% (render "header.lisp.html") %>
+<p>that's pretty neat</p>
+<% (render "footer.lisp.html") %>
```
## TODO
* [x] value interpolation (e.g `<%= link %>`)
* [x] inject variable in local scope
+* [x] auto index function from directory name
+ * [ ] add date support
+ * [ ] sort by date
+ * [ ] hook for setting link name
+* [ ] relative path from the file and the current directory
+* [ ] walk down a directory and generate all templates
+* [ ] link generator `<%= (link 'about') %>` returns `about.html`
+ and check if `about.lisp.html` exists
+* [ ] Makefile to compile and install
+* [ ] escape interpolated value