Skip to content

Enlive

The best template library for Clojure.

  • Use real web page as template, use deftempalte and defsnippet to create reusable parts.
  • Use CSS selectors for selecting the nodes on the HTML page.

Trick

  • Reload your namespace file for updating the html.

Hiccup

Quick and dirty transformation to hiccup

(defn html->hiccup
   [html]
   (if-not (string? html)
     (->> (map html->hiccup (:content html))
       (concat [(:tag html) (:attrs html)])
       (keep identity)
       vec)
     html))

Source

See also (generated)