Open mhanberg opened 1 month ago
@mhanberg I think it would be great if you want to contribute that. It is on my list to contribute it in the next couple of months if someone else hasn't beaten me to it.
I have thought about it some, so here are a couple thoughts on the implementation.
I think if we can leverage off of the actual block quote parsing, we will actually be able to use an alert anyplace a block quote can be used, which would end up being usable in many more places than the current GitHub implementation. There are quite a few complaints about these limitation in the discussion thread, https://github.com/orgs/community/discussions/16925.
I also think we should allow the overriding of the alert text by allowing any text following the key phrase to be used as the title. For example
> [!NOTE] For your attention
> Highlights information that users should take into account, even when skimming.
would use For your attention
instead of Note
for the title. This has also been mentioned in the discussion thread. It would also help address concerns about not being able to have the alert titles in other languages.
I haven't given it enough thought yet, but I wonder if there isn't a more semantic way to represent it - maybe using a header tag for the title.
I'll take a crack, thank you for your thoughts!
It turns out that the bindings for comrak that I use (MDEx) introduced a new API that will allow me to implement admonition blocks in user space, so I won't need to work on this for now, but it would obviously be better if it was builtin, in case someone else wants to tackle it!
Oh cool, glad you can do it in your own context. And thanks for posting back here - I may tackle it when I have some time.
Description
It would be great to be able to create admonition blocks, similar to how you can on GitHub
On GitHub is currently produces HTML that looks like
Rendering an SVG is much too opinionated, but I feel that rendering a div with two p tags inside and appropriate class names to style would work well.
I am interested in contributing this feature as long as there is upstream interest, thank you!