The addition of :html-block and :html-inline is very nice 🙂
I'm working on a new impl of my personal site, and more or less poorly re-implementing some ideas from nextjournal. It is a static site. One thing I wanted was to be able to inject hiccup "components" (they run at build time) into my markdown files. I used the new html-block feature to parse html, then used https://github.com/green-coder/html-to-hiccup to parse that html back into hiccup, then I can manipulate it. This is perhaps a bit inelegant but works well, an example:
This is markdown.
<ui-Alert _type="warning" _title="Watch out!">
This is style like an alert!
</ui-Alert>
This is also markdown.
Can you maybe use threads to keep the conversation about this topic focused?
Absolutely 🙂 was just replying in here..
👍 :-)
Your idea makes sense to me btw
for clojure people it would probably be even nice to be able to write hiccup?
Yes you are faster than me hehe.. So, anyways, I was wondering, why not just write hiccup directly instead of going through HTML? And I realized it was very easy to just use the :code parser to check for clojure code with a metadata tag:
clojure
^:embed
[:site.ui.alert/Alert {:title "Watch Out!" :type "warning"}
"This is a serious warning"]
This turned out to be very simple to implement, so I think I will use it instead
But in any case I am happy for the HTML support, because it is handy to have it as a quick escape hatch in markdown.👍
I think it's a great testament to the library's design that such features are easy to implement by library consumers.