From efd24109cb568dcf38f2c4214fa2d2f4a95671ce Mon Sep 17 00:00:00 2001 From: Mikey O'Toole Date: Wed, 7 Dec 2022 01:29:11 +0000 Subject: [PATCH 1/4] docs(content-docs): document theme-mermaid in the api/themes section. --- website/docs/api/themes/theme-mermaid.md | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 website/docs/api/themes/theme-mermaid.md diff --git a/website/docs/api/themes/theme-mermaid.md b/website/docs/api/themes/theme-mermaid.md new file mode 100644 index 000000000000..cba54b875aeb --- /dev/null +++ b/website/docs/api/themes/theme-mermaid.md @@ -0,0 +1,61 @@ +--- +sidebar_position: 2 +slug: /api/themes/@docusaurus/theme-classic +--- + +# 📦 theme-classic + +The classic theme for Docusaurus. + +You can refer to the [theme configuration page](theme-configuration.md) for more details on the configuration. + +```bash npm2yarn +npm install --save @docusaurus/theme-classic +``` + +:::tip + +If you have installed `@docusaurus/preset-classic`, you don't need to install it as a dependency. + +::: + +## Configuration {#configuration} + +Accepted fields: + +```mdx-code-block + +``` + +| Option | Type | Default | Description | +| --- | --- | --- | --- | +| `customCss` | string[] \| string | `[]` | Stylesheets to be imported globally as [client modules](../../advanced/client.md#client-modules). Relative paths are resolved against the site directory. | + +```mdx-code-block + +``` + +:::note + +Most configuration for the theme is done in `themeConfig`, which can be found in [theme configuration](./theme-configuration.md). + +::: + +### Example configuration {#ex-config} + +You can configure this theme through preset options or plugin options. + +:::tip + +Most Docusaurus users configure this plugin through the preset options. + +::: + +```js config-tabs +// Preset Options: theme +// Plugin Options: @docusaurus/theme-classic + +const config = { + customCss: require.resolve('./src/css/custom.css'), +}; +``` From 31a5cdd5d455c3a5f5c3ef318f90e8a7b17235f9 Mon Sep 17 00:00:00 2001 From: Mikey O'Toole Date: Wed, 7 Dec 2022 01:49:33 +0000 Subject: [PATCH 2/4] Actually commit the content. --- website/docs/api/themes/theme-mermaid.md | 62 +++++------------------- 1 file changed, 12 insertions(+), 50 deletions(-) diff --git a/website/docs/api/themes/theme-mermaid.md b/website/docs/api/themes/theme-mermaid.md index cba54b875aeb..2a9aa756a993 100644 --- a/website/docs/api/themes/theme-mermaid.md +++ b/website/docs/api/themes/theme-mermaid.md @@ -1,61 +1,23 @@ --- -sidebar_position: 2 -slug: /api/themes/@docusaurus/theme-classic +sidebar_position: 5 +slug: /api/themes/@docusaurus/theme-mermaid --- -# 📦 theme-classic +# 📦 theme-mermaid -The classic theme for Docusaurus. - -You can refer to the [theme configuration page](theme-configuration.md) for more details on the configuration. +This theme provides a `@theme/Mermaid` component that is powered by [mermaid](https://mermaid-js.github.io/). You can read more on [diagrams](../../guides/markdown-features/markdown-features-diagrams.mdx) documentation. ```bash npm2yarn -npm install --save @docusaurus/theme-classic -``` - -:::tip - -If you have installed `@docusaurus/preset-classic`, you don't need to install it as a dependency. - -::: - -## Configuration {#configuration} - -Accepted fields: - -```mdx-code-block - +npm install --save @docusaurus/theme-mermaid ``` -| Option | Type | Default | Description | -| --- | --- | --- | --- | -| `customCss` | string[] \| string | `[]` | Stylesheets to be imported globally as [client modules](../../advanced/client.md#client-modules). Relative paths are resolved against the site directory. | - -```mdx-code-block - -``` - -:::note - -Most configuration for the theme is done in `themeConfig`, which can be found in [theme configuration](./theme-configuration.md). - -::: - -### Example configuration {#ex-config} - -You can configure this theme through preset options or plugin options. - -:::tip - -Most Docusaurus users configure this plugin through the preset options. - -::: - -```js config-tabs -// Preset Options: theme -// Plugin Options: @docusaurus/theme-classic +### Configuration {#configuration} -const config = { - customCss: require.resolve('./src/css/custom.css'), +```js title="docusaurus.config.js" +module.exports = { + themes: ['@docusaurus/theme-mermaid'], + markdown: { + mermaid: true, + }, }; ``` From 8564659a57d10c419c2589dfaef85b1f3045867a Mon Sep 17 00:00:00 2001 From: Mikey O'Toole Date: Wed, 7 Dec 2022 02:50:14 +0000 Subject: [PATCH 3/4] Update website/docs/api/themes/theme-mermaid.md Co-authored-by: Joshua Chen --- website/docs/api/themes/theme-mermaid.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/api/themes/theme-mermaid.md b/website/docs/api/themes/theme-mermaid.md index 2a9aa756a993..f5817bf5aa67 100644 --- a/website/docs/api/themes/theme-mermaid.md +++ b/website/docs/api/themes/theme-mermaid.md @@ -11,7 +11,7 @@ This theme provides a `@theme/Mermaid` component that is powered by [mermaid](ht npm install --save @docusaurus/theme-mermaid ``` -### Configuration {#configuration} +## Configuration {#configuration} ```js title="docusaurus.config.js" module.exports = { From f60ff23443738331a698000ec753dcfc0ce78781 Mon Sep 17 00:00:00 2001 From: Mikey O'Toole Date: Wed, 7 Dec 2022 02:53:53 +0000 Subject: [PATCH 4/4] Update website/docs/api/themes/theme-mermaid.md Co-authored-by: Joshua Chen --- website/docs/api/themes/theme-mermaid.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/api/themes/theme-mermaid.md b/website/docs/api/themes/theme-mermaid.md index f5817bf5aa67..b9e6e99e2497 100644 --- a/website/docs/api/themes/theme-mermaid.md +++ b/website/docs/api/themes/theme-mermaid.md @@ -16,6 +16,8 @@ npm install --save @docusaurus/theme-mermaid ```js title="docusaurus.config.js" module.exports = { themes: ['@docusaurus/theme-mermaid'], + // In order for Mermaid code blocks in Markdown to work, + // you also need to enable the Remark plugin with this option markdown: { mermaid: true, },