Search code examples
htmlmacroscode-generationelisp

Is there an Emacs Lisp library for generating HTML?


I'm looking for a solution that allows me to write native Emacs Lisp code and at compile time turns it into HTML, like Franz's htmlgen:

(html
 ((:div class "post")
  (:h1 "Title")
  (:p "Hello, World!")))

Of course I can write my own macros, but I'm interested if there are any projects around this problem.


Solution

  • Meanwhile, I found some code that contains something similar I want. Now I can write:

    (views-with-html
     ((body)
      (h1 "Title")
      ((p (class . "entry")) "Hello, World!")))
    

    The implementation has a few limitations (e.g. hard-coded element list), but it seems to be a good starting point.