executablebooks / MyST-Parser

An extended commonmark compliant parser, with bridges to docutils/sphinx
https://myst-parser.readthedocs.io
MIT License
703 stars 188 forks source link

Add an extension to support GitHub alerts #845

Open njzjz opened 6 months ago

njzjz commented 6 months ago

Describe the feature you'd like to request

Last week, GitHub supported alerts as follows:

> [!NOTE]
> This is a note

[!NOTE] This is a note

See:

I hope myst-parser can add an extension to provide the same feature to provide a consistent preview for GitHub and Sphinx.

Describe the solution you'd like

Add an option to myst_enable_extensions to allow such syntax.

Describe alternatives you've considered

No response

chrisjsewell commented 6 months ago

Heya, it would probably be best if one first implemented a plugin in https://github.com/executablebooks/mdit-py-plugins

My only word of warning here, is that

  1. They have already flip-flopped on this, changing from the initial syntax they had before November 2023 > **Note** to this new one, lets hope they don't change again 😒
  2. I would agree with others in the comments for this feature; https://github.com/orgs/community/discussions/16925#discussioncomment-2794978, it basically tends to break the semantics of the blockquote syntax

Its also frustrating that Github seem to have abandoned their past spec for Github Flavoured Markdown, https://github.github.com/gfm/, when implementing these new features.

orsinium commented 6 months ago

+1 to the feature. While the syntax introduced by Github may suck, it is quite convenient to be able to produce documentation that is rendered in about the same way in both Github and Myst-powered web pages. Currently, the admonitions look bad on Github:

image