This is a Docusaurus theme to add support for MDX v2 until it is officially supported.
2.0.0-beta.18
or later@mdx-js/react
dependency to version ^2.0.0
docusaurus-theme-mdx-v2
npm install docusaurus-theme-mdx-v2
mdx-v2
theme to your docusaurus.config.js
// ...
const config = {
//...
presets: [...],
themes: ["mdx-v2"],
themeConfig: ...
//...
}
// ...
<!--comment-->
anymore. Now you should use something like {/* prettier-ignore */}
{
in your prose like this \{
MDXComponents
, MDX v2 will throw an error (v1 only showed a warning)Instead of using the markdown syntax for admonitions, you should use the
<Admonition />
component.
Instead of this:
:::note Your Title
Some **content** with _markdown_ `syntax`.
:::
Use this:
import Admonition from '@theme/Admonition'
<Admonition type="note" title="Your Title">
Some **content** with _markdown_ `syntax`.
</Admonition>
MIT