mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-04 12:47:14 +02:00
* attempt to support html embeds in mdx with format md * refactor mdx loader + support embedding html in commonmark thanks to rehype-raw * extract processor code * refactor processor code * extract format + unit test * try to refactor processor * try to refactor processor * adjust md page * do not apply rehype-raw when format is mdx * fix lint issue |
||
---|---|---|
.. | ||
src | ||
.npmignore | ||
package.json | ||
README.md | ||
tsconfig.json |
@docusaurus/mdx-loader
Docusaurus webpack loader for MDX.
Installation
yarn add @docusaurus/mdx-loader
Usage
// ...
module: {
rules: [
// ...
{
test: /\.mdx?$/,
use: [
'babel-loader',
{
loader: '@docusaurus/mdx-loader',
options: {
// .. See options
},
},
],
},
];
}
Options
rehypePlugins
Array of rehype plugins to manipulate the MDXHAST
remarkPlugins
Array of remark plugins to manipulate the MDXAST
metadataPath
A function to provide the metadataPath depending on current loaded MDX path that will be exported as the MDX metadata.
markdownConfig
The global Docusaurus Markdown config (config.markdown
), that plugin authors should forward:
const loader = {
loader: require.resolve('@docusaurus/mdx-loader'),
options: {
markdownConfig: siteConfig.markdown,
},
};