nextjournal

Casey 2025-06-09T12:11:23.246039Z

The addition of :html-block and :html-inline is very nice 🙂

👍 1
1
Casey 2025-06-09T12:15:52.588879Z

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.

borkdude 2025-06-09T12:17:21.354749Z

Can you maybe use threads to keep the conversation about this topic focused?

Casey 2025-06-09T12:17:39.791339Z

Absolutely 🙂 was just replying in here..

borkdude 2025-06-09T12:17:47.992899Z

👍 :-)

borkdude 2025-06-09T12:31:33.282789Z

Your idea makes sense to me btw

borkdude 2025-06-09T12:32:03.019199Z

for clojure people it would probably be even nice to be able to write hiccup?

Casey 2025-06-09T12:35:32.218789Z

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.

borkdude 2025-06-09T12:36:16.855349Z

👍

Casey 2025-06-09T12:37:09.505269Z

I think it's a great testament to the library's design that such features are easy to implement by library consumers.