Introduction
HelpMate is a Clojure/ClojureScript library for templating/emitting SGML-like content. It uses S-Expressions to represent elements, and maps to represent an element’s attributes. HelpMate is a strained portmanteau of Helpful HTML template.
All the current HTML and SVG elements are represented with doc-strings scraped from Mozilla Developer Network, the content of which is available under the terms of the Creative Commons Attribution-ShareAlike license (CC-BY-SA), v2.5.
Planned additional definitions include
Custom elements can be created by way of the defelem
macro: this allows arbitrary SGML tags to be represented in regular Clojure code, intersperced with forms like map
and for
, making templating much more convenient:
(defelem ul)
(defelem li)
(ul
(for [x (range 1 4)]
(li x)))
; => "<ul><li>1</li><li>2</li><li>3</li></ul>"