feat: support mermaid code blocks in Markdown (#7490)

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
Sam Wall 2022-10-14 17:07:20 +01:00 committed by GitHub
parent d2fdd981f7
commit 9c92a79d23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 1666 additions and 13 deletions

View file

@ -16,6 +16,20 @@ export type ThemeConfig = {
[key: string]: unknown;
};
export type MarkdownConfig = {
/**
* Allow mermaid language code blocks to be rendered into Mermaid diagrams:
*
* - `true`: code blocks with language mermaid will be rendered.
* - `false` | `undefined` (default): code blocks with language mermaid
* will be left as code blocks.
*
* @see https://docusaurus.io/docs/markdown-features/diagrams/
* @default false
*/
mermaid?: boolean;
};
/**
* Docusaurus config, after validation/normalization.
*/
@ -277,6 +291,8 @@ export type DocusaurusConfig = {
*/
jsLoader: 'babel' | ((isServer: boolean) => RuleSetRule);
};
/** Markdown-related options. */
markdown: MarkdownConfig;
};
/**

View file

@ -8,6 +8,7 @@
export {
ReportingSeverity,
ThemeConfig,
MarkdownConfig,
DocusaurusConfig,
Config,
} from './config';