remarkjs/remark

🚀 Support Github-style Alerts, Callouts, etc. (Beta)

Closed this issue · 9 comments

Initial checklist

Problem

Github recently implemented a very neat feature for adding various tagged callouts to GFM. I'd love to use this in my various projects internally relying on Remark! Typora (the application I actually write most of my content in) also recently added support, though I'm not sure which markdown engine they're running

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

Solution

Not exactly sure the implementation here, but the discussion link over on the GFM side illustrates the intended outcome well!

Alternatives

It's not currently implemented, so I suppose the alternative is to just not do this 😉😜

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

Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.

See our support docs for how and where to ask questions.

Thanks,
— bb

D'oh! Apologies!

Note for others — this got implemented as a Rehype plugin. See https://github.com/chrisweb/rehype-github-alerts

I also created a Remark plugin to transform GitHub's syntax to the directives syntax: remark-github-admonitions-to-directives

I strongly recommend making rehype plugins, rehype works on HTML, GH does this on HTML!

@wooorm I understand, but my plugin doesn't produce HTML on purpose so existing tools using the directives syntax (like Docusaurus and the admonitions plugin) can be reused. It just converts MD syntax A to MD syntax B.

ahh right, sorry, missed the last part!