-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Alerts in Github Flavored Markdown #331
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Heya yeh it would go in https://github.com/executablebooks/mdit-py-plugins |
I found the a page about markdown formatting in the docs, it seems to be a lot more up to date than their specification, apparently they are called alerts. They use octicons which are MIT licensed so we can use the same ones, specifically (Just noticed color in backticks is another missing feature, github has been adding a ton of things lately) |
I made a plugin that parses them and renders them like normal blockquotes but inserts Is there interest in support arbitrary alerts? It should be pretty straight forward to implement (I'm currently storing the alert type as an enum but I can change it to a string, of course from a whitelisted list to not allow arbitrary user input reflected classes) Here the generated html: <p>Text</p>
<blockquote>
<p>Quote</p>
</blockquote>
<blockquote class="alert alert-note">
<p>Highlights information that users should take into account, even when skimming.</p>
</blockquote>
<blockquote class="alert alert-tip">
<p>Optional information to help a user be more successful.</p>
</blockquote>
<blockquote class="alert alert-important">
<p>Crucial information necessary for users to succeed.</p>
</blockquote>
<blockquote class="alert alert-warning">
<p>Critical content demanding immediate user attention due to potential risks.</p>
</blockquote>
<blockquote class="alert alert-caution">
<p>Negative potential consequences of an action.</p>
</blockquote> And here's how it looks in my project with styling as an example: |
Context
I noticed Alerts are not supported.
They are pretty poorly specified as they are completely absent from the specification, in fact the only official information from github I found acknowledging they exist is the discussion I linked above.
Proposal
Add support for alerts, and enable it by default in the
gfm-like
flavor.Is this out of scope for the core project and should be left to a plugin? I noticed task lists are a plugin instead of being supported by default which is strange to me because they are fairly common.
Tasks and updates
Add support for each of them in the renderer:
The text was updated successfully, but these errors were encountered: