emacs-love/templatel

Jinja inspired template language for Emacs Lisp

Emacs Lisp

64

212 commits

updated Jul 6, 2024

See the code

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
   <h1>{{ title }}</h1>
   <ul>
     {% for user in users %}
       <li><a href="{{ user.url }}">{{ user.name }}</a></li>
     {% endfor %}
   </ul>
   #+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
   <h1>A nice web page</h1>
   <ul>
     <li><a href="https://emacs.love">link</a></li>
     <li><a href="https://gnu.org">Gnu!!</a></li>
   </ul>
   #+end_src

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

emacs
jinja2
template-engine

Contributors

clarete

208 commits

clarete-dd

2 commits

markokocic

2 commits

emacs-love/templatel

Jinja inspired template language for Emacs Lisp

Emacs Lisp

64

212 commits

updated Jul 6, 2024

See the code

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
   <h1>{{ title }}</h1>
   <ul>
     {% for user in users %}
       <li><a href="{{ user.url }}">{{ user.name }}</a></li>
     {% endfor %}
   </ul>
   #+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
   <h1>A nice web page</h1>
   <ul>
     <li><a href="https://emacs.love">link</a></li>
     <li><a href="https://gnu.org">Gnu!!</a></li>
   </ul>
   #+end_src

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

emacs
jinja2
template-engine

Contributors

clarete

208 commits

clarete-dd

2 commits

markokocic

2 commits

Languages

Emacs Lisp

99.6%