3 ms·
> The ability to create tag templates basically. You'd define tags that you could parameterize using attributes, and then within the custom tag "body" would be
by mschaef 3y ago
> The ability to create tag templates basically. You'd define tags that you could parameterize using attributes, and then within the custom tag "body" would be more tags definitions.
Not sure how it might be supported in this library, but Hiccup (in the Clojure) ecosystem is similar and lets you do this with functions. This is a simple example of a scrollable div with a title block.
(defelem scroll-column [ id title & contents ]
[:div.scroll-column
[:div.fixed title]
[:div.scrollable { :id id :data-preserve-scroll "true" }
contents]])
Note this (and Hiccup in general) heavily depends on Clojure array and hash literals. This wouldn't look as clean in a Lisp without those things.