Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emacs-love/templatel
Jinja inspired template language for Emacs Lisp
https://github.com/emacs-love/templatel
emacs jinja2 template-engine
Last synced: 3 months ago
JSON representation
Jinja inspired template language for Emacs Lisp
- Host: GitHub
- URL: https://github.com/emacs-love/templatel
- Owner: emacs-love
- License: gpl-3.0
- Created: 2020-06-17T02:46:51.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-06T03:22:29.000Z (7 months ago)
- Last Synced: 2024-10-25T23:59:02.623Z (3 months ago)
- Topics: emacs, jinja2, template-engine
- Language: Emacs Lisp
- Homepage: https://emacs.love/templatel
- Size: 211 KB
- Stars: 54
- Watchers: 6
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.org
- License: COPYING
Awesome Lists containing this project
README
#+CAPTION: CI Status
#+NAME: CI
[[https://github.com/clarete/templatel/workflows/CI/badge.svg]]#+CAPTION: Melpa
#+NAME: Melpa
[[https://melpa.org/#/templatel][file:https://melpa.org/packages/templatel-badge.svg]]* templatel
A modern templating language for Emacs-Lisp. Inspired on [[https://github.com/pallets/jinja/][Jinja]],
/templatel/ brings a high level language for expanding variables
with conditional and loop control flow structures.** Documentation
* Website: https://emacs.love/templatel
* Documentation: https://emacs.love/templatel/doc
* Code: https://github.com/emacs-love/templatel
* Issues: https://github.com/emacs-love/templatel/issues** How does it look like
#+begin_src jinja
{{ title }}
- {{ user.name }}
{% for user in users %}
{% endfor %}
#+end_src
That can be rendered with the following Emacs Lisp code:
#+begin_src emacs-lisp
(templatel-render-file "tmpl.html.jinja"
'(("title" . "A nice web page")
("users" . ((("url" . "https://emacs.love")
("name" . "link"))
(("url" . "https://gnu.org")
("name" . "Gnu!!"))))))
#+end_src
The rendered code would look like this:
#+begin_src html
A nice web page
#+end_src