You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use directives or other syntax to support alerts, admonitions, etc.
examples of directive-based admonition/alert syntax that may be used in md(x) taken from the docusaurus docs
:::note
Some **content** with _Markdown_`syntax`. Check [this `api`](#).
::::::tip
Some **content** with _Markdown_`syntax`. Check [this `api`](#).
::::::info
Some **content** with _Markdown_`syntax`. Check [this `api`](#).
::::::warning
Some **content** with _Markdown_`syntax`. Check [this `api`](#).
::::::danger
Some **content** with _Markdown_`syntax`. Check [this `api`](#).
:::
Describe the solution you'd like
It would be helpful to support github-flavored markdown or mdx files that contain this style of alert or directive-based admonition syntax.
Describe alternatives you've considered
fumadocs already supports this via components in mdx for example
cameronraysmith
changed the title
Support directive-based admonitions and alerts
Support directive-based admonitions and alerts for mdx and md sources
Jul 26, 2024
I personally avoid these syntax as it is not the standard of CommonMark and MDX, but JSX is. I think we can offer a rehype plugin for people migrating from other docs frameworks as JSX (using the component directly) is more flexible and friendly.
In MDX, intellisense works for directly imported components which makes it significantly easier to use.
I agree. For my use case it's probably better to just write a pandoc lua filter | like this one for docusaurus that specifically targets translation to fumadocs-compatible Callout components in MDX wherever the source markdown uses directive syntax. I will close this as I think that will likely be a better solution and shouldn't require any change to fumadocs. Many thanks!
What problem will this feature address?
Several widely-used markdown extensions such as those in
use directives or other syntax to support alerts, admonitions, etc.
examples of directive-based admonition/alert syntax that may be used in md(x) taken from the docusaurus docs
Describe the solution you'd like
It would be helpful to support github-flavored markdown or mdx files that contain this style of alert or directive-based admonition syntax.
Describe alternatives you've considered
fumadocs already supports this via components in mdx for example
however, I am not sure if there is a built-in approach to translate the directive syntax like that utilized by docusaurus to
Callout
components using a custom MDX -> JSX transform function with a content-collection source for mdx.It should also be possible to use remark plugins
together with appropriate styles to support this with markdown if there is not already a simpler approach I am not aware of. This could be facilitated by a complementary content-collection MD -> HTML transform function for markdown
The text was updated successfully, but these errors were encountered: