Markup
Markup is an HTML generator, where instead of encoding HTML as lisp sexps, you can write HTML directly in lisp code. This allows for copy pasting templates and snippets and working with external developers, while still giving you all the power of Lisp.

This works by constructing a DOM tree before serializing, so it still gives all the correctness that libraries like CL-WHO provide.

Here's a complete example:

(markup:enable-reader) (markup:deftag template (children &key title) <html> <head> <title>,(progn title)</title> </head> <body> ,@children </body> </html>) (hunchentoot:define-easy-handler (foobar :uri "/") () (markup:write-xml <template title="Hello" > <h1>hello world!</h1> </template>))

Depends on: str, alexandria, named-readtables, trivial-gray-streams

Repository: https://github.com/moderninterpreters/markup

License: Apache 2


HTML Generator