Skip to content

Commit

Permalink
Add admonitions support to fallback mdx loader
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Aug 11, 2021
1 parent ee6ebc4 commit 9d3f740
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"react-router": "^5.2.0",
"react-router-config": "^5.1.1",
"react-router-dom": "^5.2.0",
"remark-admonitions": "^1.2.1",
"resolve-pathname": "^3.0.0",
"rtl-detect": "^1.0.3",
"semver": "^7.3.4",
Expand Down
2 changes: 2 additions & 0 deletions packages/docusaurus/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
} from './translations/translations';
import {mapValues} from 'lodash';
import {RuleSetRule} from 'webpack';
import admonitions from 'remark-admonitions';

export type LoadContextOptions = {
customOutDir?: string;
Expand Down Expand Up @@ -225,6 +226,7 @@ function createMDXFallbackPlugin({siteDir}: {siteDir: string}): LoadedPlugin {
staticDir: path.join(siteDir, STATIC_DIR_NAME),
isMDXPartial: (_filename) => true, // External mdx files are always meant to be imported as partials
isMDXPartialFrontMatterWarningDisabled: true, // External mdx files might have frontmatter, let's just disable the warning
remarkPlugins: [admonitions],
},
},
],
Expand Down

0 comments on commit 9d3f740

Please sign in to comment.