mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +02:00
refactor: handle all admonitions via JSX component (#7152)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
17fe43ecc8
commit
5746c58f41
39 changed files with 709 additions and 250 deletions
|
@ -90,7 +90,6 @@
|
|||
"react-router": "^5.3.3",
|
||||
"react-router-config": "^5.1.1",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"rtl-detect": "^1.0.4",
|
||||
"semver": "^7.3.7",
|
||||
"serve-handler": "^6.1.3",
|
||||
|
|
2
packages/docusaurus/src/deps.d.ts
vendored
2
packages/docusaurus/src/deps.d.ts
vendored
|
@ -5,8 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
declare module 'remark-admonitions';
|
||||
|
||||
declare module 'react-loadable-ssr-addon-v5-slorber' {
|
||||
import type {WebpackPluginInstance, Compiler} from 'webpack';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import path from 'path';
|
||||
import admonitions from 'remark-admonitions';
|
||||
import type {RuleSetRule} from 'webpack';
|
||||
import type {HtmlTagObject, LoadedPlugin, LoadContext} from '@docusaurus/types';
|
||||
|
||||
|
@ -97,6 +96,7 @@ export function createMDXFallbackPlugin({
|
|||
});
|
||||
}
|
||||
const mdxLoaderOptions = {
|
||||
admonitions: true,
|
||||
staticDirs: siteConfig.staticDirectories.map((dir) =>
|
||||
path.resolve(siteDir, dir),
|
||||
),
|
||||
|
@ -105,7 +105,6 @@ export function createMDXFallbackPlugin({
|
|||
isMDXPartial: () => true,
|
||||
// External MDX files might have front matter, just disable the warning
|
||||
isMDXPartialFrontMatterWarningDisabled: true,
|
||||
remarkPlugins: [admonitions],
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue