remarkjs/remark-gfm

Support GitHub's note/warning/information alerts?

Elchi3 opened this issue · 12 comments

Elchi3 commented

Initial checklist

Problem

Currently, there are many different ways to express note/warning/information alert boxes.

For example, from your own docs, this could be transformed into a GitHub note box:

👉 Note: before participating in our community, please read our
[code of conduct][coc].

MDN searches for the following syntax to render an alert box:

Warning: If you just see "1 3" instead of a fraction, then your browser may not support MathML.

Solution

GitHub seems to have added a syntax for note/warning/info alert boxes to GFM. They render like this:

Note

Highlights information that users should take into account, even when skimming.

Important

Crucial information necessary for users to succeed.

Warning

Critical content demanding immediate user attention due to potential risks.

See https://github.com/orgs/community/discussions/16925

Will this be supported in remark-gfm?

Alternatives

.

remark-gfm is about adding GFM syntax. What you’re proposing, is to alter HTML output. This is out of scope for this project. It would be nice to have in https://github.com/rehypejs/rehype-github though.

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

Hi team! Could you describe why this has been marked as external?

Thanks,
— bb

Hi team! I don’t know what’s up as there’s no phase label. Please add one so I know where it’s at.

Thanks,
— bb

Hi team! I don’t know what’s up as there’s no phase label. Please add one so I know where it’s at.

Thanks,
— bb

Hi team! Could you describe why this has been marked as external?

Thanks,
— bb

Elchi3 commented

remark-gfm is about adding GFM syntax.

Thanks, my understanding was that > [!NOTE] , > [!IMPORTANT] and > [!WARNING] is new GFM syntax.

What you’re proposing, is to alter HTML output. This is out of scope for this project. It would be nice to have in https://github.com/rehypejs/rehype-github though.

Okay, I'm happy to file an issue there.

Oh, I see they recently added a new syntax. Now I’m not entirely sure anymore.

Hi team! I don’t know what’s up as there’s no phase label. Please add one so I know where it’s at.

Thanks,
— bb

wooorm commented

Hi!

is new GFM syntax.

There are tons of features GH does on its platform to markup.
There are very few features part of GFM. Here is their GFM parser: https://github.com/github/cmark-gfm. It does not include this.
So remco is correct, this does not go here!

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

For anyone interested; I created a Remark plugin to transform GitHub's syntax to the directives syntax used by admonitions: remark-github-admonitions-to-directives