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:
Alexey Pyltsyn 2022-06-03 15:26:33 +03:00 committed by GitHub
parent 17fe43ecc8
commit 5746c58f41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 709 additions and 250 deletions

View file

@ -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",

View file

@ -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';

View file

@ -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 {