From d3c3ae47a2937bf0ace994a4bc9928cd2f3605de Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 11 Jan 2021 18:18:48 +0100 Subject: Added make-index builtin --- README.md | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'README.md') 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)) %> + +``` + +Use the `render` function to include a template in another. + +```html +<% (render "header.lisp.html") %> +

that's pretty neat

+<% (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 -- cgit