Add admonitions/callout support to markdown/mdx #860
Replies: 3 comments
-
related: #423 |
Beta Was this translation helpful? Give feedback.
-
For plain MD it would be nice to choose our MD flavor. I'd like to be able to write GFM along with callouts/admonitions that view correctly on GitHub and then be able to pull those MD files into an app and render HTML without having to go through and modify to a different syntax. |
Beta Was this translation helpful? Give feedback.
-
As nothing more than a user, I would suggest/kindly ask to stay with the common Also, user defined format sounds nice, but it seems more complex and I would expect it to cause many more non-bug reports due to user error than the alternative. Maybe imposing a format would make for an easier first approach? Just my two cents, looking forward to having support for this built-in. |
Beta Was this translation helpful? Give feedback.
-
Summary
"admonitions", callouts, notes, warnings and the like are common enough in markdown/mdx and I think it would be great if Astro could natively support this allowing Astro components to be mapped to user specified admonitions.
I believe that the bulk of this work has already been implemented in Starlight, can that be brought into core?
Background & Motivation
Currently, the closest feature is to use mdx and import a component like this:
However this is sometimes adds more friction than desirable:
:::
than angle bracketsThis has previously been mentioned in #424 and #825.
Goals
A concise, bulleted-list outlining the intended goals of this RFC.
:::tip[Did you know?]
Example
I propose that
astro.config.ts
file has an option such as the following.Remaining questions
This has some design decisions that need making:
:::tip
or the recent GitHub added format> [!TIP]
? Personally I prefer the:::
format.'tip': Tip
or':::tip': Tip,
in the config? I suspect imposing a format would lead to less complexity with remark/rehype.Should this support loading client framework components? I suspect this one needs some thought, considering mdx files are required whereas admonitions should work in both markdown and mdx. It may be just less complex to restrict this to Astro components (where users would be free to use their client framework components in them (I think?)).Probably the only practical option here is to only allow this RFC for mdx files.Beta Was this translation helpful? Give feedback.
All reactions