Github-Flavored Markdown supports https://github.blog/changelog/2023-12-14-new-markdown-extension-alerts-provide-distinctive-styling-for-significant-content/, which are quote blocks with colored margin bar and a colored header. Flexmark Java doesn't support this (https://github.com/vsch/flexmark-java/issues/612), but they have an extension (https://github.com/vsch/flexmark-java/wiki/Admonition-Extension) which works differently than the Github-Flavored Markdown alerts (uses a different syntax, requires javascript, supports a different set of types). I implemented support of the GFM style alerts in my blog (https://github.com/NoahTheDuke/NoahTheDuke.github.io/blob/d4f0eb1386f1985c842aee8d9225fe2d3725d95c/src/cryogen_core/util.clj#L66-L95) which was pretty simple but my implementation uses selmer to parse the flexmark-resulting html, which y'all might not want. would you be interested in supporting the github style alerts?
https://clojurians.slack.com/archives/C8V0BQ0M6/p1728507570659029
hell yeah!!!!!!!!
looking at the code, i think you strip icon-tip etc from the resulting html. adding support for alerts would probably require allowing those.
Hi @nbtheduke! Yes, cljdoc should support Github-Flavored alerts. I just used these recently on https://github.com/clj-holmes/clj-watson (which is not on cljdoc, but whatevs, just to show you I am hip to these new-fangled alerts!). AsciiDoc has long had this concept and calls them admonitions. Since there is a one-to-one match between admonitions and alerts, I'm guessing that's where GitHub got the idea. Cljdoc tries to render docs consistently, whether they be adoc or md. Love it or hate it, here's https://cljdoc.org/d/org.cljdoc/cljdoc-exerciser/1.0.100/doc/document-tests/asciidoctor-features#_admonitions. We'd render alerts the same way. Flexmark's author is much less active (probably inactive now) these days. I dove into Flexmark a while ago to compensate for a bug. I found it to be a complex beast but also flexible and extensible. I'd probably dig in and see if I could just extend Flexmark to support alerts directly and completely (and not use Selmer). All that said, please raise an issue (copy paste of our conversation here would be fine). I've been neck-deep in moving cljdoc over to Exoscale for the last loooooong while (cljdoc deploys are currently broken on DigitalOcean). I think I am finally getting to the finish line, but I don't have an estimate for when I'll get there. But I can look at this after I finish that.
omg that sounds like hell, so good luck with that!
i didn't put a ton of time into it, but i tried to figure out how to make an extension for flexmark a couple weeks ago when i added alerts to my blog and it was... annoying. i'm not a good java developer so that's definitely part of it
The ops work is actually sometimes very interesting! I now somewhat know what consul, nomad, traefik, and terraform do!
the code for using selmer was like... 10 lines? 15 lines total? felt dead simple to write, comparatively
Yeah, working with Flexmark is a bit head-spinny for me. Soooo many classes.