From 7cba061d187236913aae0ae47cc76625b2bc8a44 Mon Sep 17 00:00:00 2001 From: Tim Maffett Date: Fri, 29 Apr 2022 10:01:25 -0700 Subject: [PATCH 1/5] add missing quotes to example theme default --- docs/8.6.0_docs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/8.6.0_docs.md b/docs/8.6.0_docs.md index 68da8f868..f5ebfc1ab 100644 --- a/docs/8.6.0_docs.md +++ b/docs/8.6.0_docs.md @@ -7,7 +7,7 @@ With version 8.6.0 comes the release of directives for mermaid, a new system for modifying configurations, with the aim of establishing centralized, sane defaults and simple implementation. `directives` allow for a single-use overwriting of `config`, as it has been discussed in [Configurations](./Setup.md). -This allows site Diagram Authors to instantiate temporary modifications to `config` through the use of [Directives](), which are parsed before rendering diagram definitions. This allows the Diagram Authors to alter the appearance of the diagrams. +This allows site Diagram Authors to instantiate temporary modifications to `config` through the use of [Directives](), which are parsed before rendering diagram definitions. This allows the Diagram Authors to alter the appearance of the diagrams. **A likely application for this is in the creation of diagrams/charts inside company/organizational webpages, that rely on mermaid for diagram and chart rendering.** @@ -65,7 +65,7 @@ init would be an argument-directive: `%%{init: { **insert argument here**}}%%` The json object that is passed as {**argument** } must be valid, quoted json or it will be ignored. **for example**: -`%%{init: {"theme": default, "logLevel": 1 }}%%` +`%%{init: {"theme": "default", "logLevel": 1 }}%%` Configurations that are passed through init cannot change the parameters in secure arrays of higher levels. In the event of a conflict, mermaid will give priority to secure arrays and parse the request, without changing the values of the parameters in conflict. From 01272386451cbd193bf9d2153b8d014078cec431 Mon Sep 17 00:00:00 2001 From: Tim Maffett Date: Fri, 29 Apr 2022 17:46:19 -0700 Subject: [PATCH 2/5] protect config.js from attempting to use invalid theme name --- src/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.js b/src/config.js index a9fca15e8..7ae58cc32 100644 --- a/src/config.js +++ b/src/config.js @@ -27,7 +27,7 @@ export const updateCurrentConfig = (siteCfg, _directives) => { cfg = assignWithDepth(cfg, sumOfDirectives); - if (sumOfDirectives.theme) { + if (sumOfDirectives.theme && theme[sumOfDirectives.theme]) { const tmpConfigFromInitialize = assignWithDepth({}, configFromInitialize); const themeVariables = assignWithDepth( tmpConfigFromInitialize.themeVariables || {}, @@ -59,7 +59,7 @@ export const setSiteConfig = (conf) => { siteConfig = assignWithDepth({}, defaultConfig); siteConfig = assignWithDepth(siteConfig, conf); - if (conf.theme) { + if (conf.theme && theme[conf.theme]) { siteConfig.themeVariables = theme[conf.theme].getThemeVariables(conf.themeVariables); } From 1128f53fdc96749b22ff576b6fc6c400bacf0a9d Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Sun, 1 May 2022 21:10:51 -0700 Subject: [PATCH 3/5] Update integrations.md --- docs/integrations.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/integrations.md b/docs/integrations.md index b1787c93c..8fa05f637 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -6,7 +6,10 @@ They also serve as proof of concept, for the variety of things that can be built ## Productivity - +- [GitHub](https://github.com) (**Native support**) + - [Using code blocks](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) (**Native support**) + - [GitHub action: Compile mermaid to image](https://github.com/neenjaw/compile-mermaid-markdown-action) + - [svg-generator](https://github.com/SimonKenyonShepard/mermaidjs-github-svg-generator) - [GitLab](https://docs.gitlab.com/ee/user/markdown.html#diagrams-and-flowcharts) (**Native support**) - [Gitea](https://gitea.io) (**Native support**) - [Azure Devops](https://docs.microsoft.com/en-us/azure/devops/project/wiki/wiki-markdown-guidance?view=azure-devops#add-mermaid-diagrams-to-a-wiki-page) (**Native support**) @@ -14,10 +17,6 @@ They also serve as proof of concept, for the variety of things that can be built - [Joplin](https://joplinapp.org) (**Native support**) - [Notion](https://notion.so) (**Native support**) - [Observable](https://observablehq.com/@observablehq/mermaid) (**Native support**) -- [GitHub](https://github.com) (**Native support**) - - [GitHub action: Compile mermaid to image](https://github.com/neenjaw/compile-mermaid-markdown-action) - - [svg-generator](https://github.com/SimonKenyonShepard/mermaidjs-github-svg-generator) - - [Using code blocks](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) (**Native support**) - [GitBook](http://gitbook.com) - [Mermaid Plugin](https://github.com/JozoVilcek/gitbook-plugin-mermaid) - [Markdown with Mermaid CLI](https://github.com/miao1007/gitbook-plugin-mermaid-cli) From 86bf447782e13152439301a117a14749e8a6a15b Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Sun, 1 May 2022 21:13:17 -0700 Subject: [PATCH 4/5] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index db1ddc3ce..39291c405 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,11 @@ Diagramming and documentation costs precious developer time and gets outdated qu But not having diagrams or docs ruins productivity and hurts organizational learning.
Mermaid addresses this problem by enabling users to create easily modifiable diagrams, it can also be made part of production scripts (and other pieces of code).

-Mermaid allows even non-programmers to easily create detailed and diagrams through the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/).
-[Tutorials](./docs/Tutorials.md) has video tutorials. +Mermaid allows even non-programmers to easily create detailed charts and diagrams through the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/).
+ Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/integrations.md). -For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/n00b-overview.md) and [Usage](./docs/usage.md). +For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/n00b-overview.md), [Usage](./docs/usage.md) and [Tutorials](./docs/Tutorials.md). 🌐 [CDN](https://unpkg.com/mermaid/) | 📖 [Documentation](https://mermaidjs.github.io) | 🙌 [Contribution](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md) | 📜 [Changelog](./docs/CHANGELOG.md) From bae5b9ddeac89938c956bd40ce95763e62bfd92f Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Sun, 1 May 2022 21:16:18 -0700 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39291c405..ca52e4de6 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Mermaid addresses this problem by enabling users to create easily modifiable dia
Mermaid allows even non-programmers to easily create detailed charts and diagrams through the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/).
-Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/integrations.md). +You can also use Mermaid within [GitHub](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) as well many of your other favorite applications, check out the list of [Integrations and Usages of Mermaid](./docs/integrations.md). For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/n00b-overview.md), [Usage](./docs/usage.md) and [Tutorials](./docs/Tutorials.md).