stefanfritsch / goldmark-admonitions

Markdown admonitions for the goldmark Go markdown parser
MIT License
1 stars 0 forks source link

Align with admonitions in GitHub Flavored Markdown #1

Open vanbroup opened 1 year ago

vanbroup commented 1 year ago

It would be great if this would align with the GitHub implementation, see also https://github.com/orgs/community/discussions/16925

This markdown:

> **Note**
> This is a note

> **Warning**
> This is a warning

Will be shown as:

Note This is a note

Warning This is a warning

There are also other implementations that might be more flexible: https://github.com/orgs/community/discussions/16925#discussioncomment-2803633

stefanfritsch commented 1 year ago

Hmm, how would you decide whether that's a blockquote starting with a "Note" in bold or an admonition? I can imagine quite a few cases where a quote would start with Note or Warning. I can't say that I like the syntax. I'd accept a pull request if there's an option to enable/disable that syntax.

I'm sorry if that's not the answer you wanted to hear :-(

For the alternatives:

vanbroup commented 1 year ago

The GitHub system is not perfect, but it feels natural even when not rendered. It would have my preference as we manage a lot of the projects within GitHub. Potentially the > **Warning** instructor can be given its own class so that you can hide it using CSS and so something like > **Warning** **An important message** which would result in the warning display but with a different title (outside GitHub).

jiriks74 commented 4 months ago

Github updated it's way of handling admonitions.

Not the syntax looks like this:

> [!Note]
> This is a note

resulting in

[!Note] This is a note

The following admonitions are also possible:

[!Tip] This is a tip!

[!Warning] This is a warning!

[!Important] This is important!

[!Caution] Be cautious!

The same syntax is currently supported by Gitea too.


For more information see this Github discussion