PGijsbers / admonitions

Plugin to convert GitHub-style admonitions to `mkdocs-material`-style admonitions when building docs.
https://pgijsbers.github.io/admonitions
MIT License
3 stars 0 forks source link

Support GitHub `caution` and `important` via custom admonition #1

Open cdwilson opened 3 weeks ago

cdwilson commented 3 weeks ago

Thanks for this great extension!

I was wondering if it would be possible to support GitHub caution and important via custom admonitions.

I did a quick test and was able to get something similar working using custom admonitions with the https://oprypin.github.io/markdown-callouts/ extension and css from https://github.com/squidfunk/mkdocs-material/issues/6667#issuecomment-2165055127

Just was curious if it would be possible to have these admonitions provided by this extension.

PGijsbers commented 3 weeks ago

I don't think that the mkdocs plugin should be adding CSS. However, maybe it can be psuedo supported by:

cdwilson commented 3 weeks ago

I don't think that the mkdocs plugin should be adding CSS

Makes sense. I was originally thinking that it might be nice to just have this work "out of the box" without having to provide any custom CSS. That said, this is probably something that people will probably want to customize (different colors, icons, etc), especially if they aren't using the Material theme.

When I originally filed this issue, I was just looking for a way to customize the appearance of the Caution and Important alerts. However, I was actually able to get this working with the markdown-gfm-admonition extension and some custom CSS (see https://github.com/squidfunk/mkdocs-material/issues/6667#issuecomment-2308612453), so if you want to close this out, I'm totally happy to just use that solution instead.

That said, if you still want to implement this, I think any solution that allows using custom CSS (as described in https://squidfunk.github.io/mkdocs-material/reference/admonitions/?h=admoni#custom-admonitions) would solve my original request.

PGijsbers commented 3 weeks ago

I'll leave it open for now and re-evaluate what to do when I would actually have time to work on it. Thanks again for the suggestion :)