-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Laurent Franceschetti
committed
Aug 9, 2023
1 parent
6d6aa1d
commit 70b52d0
Showing
1 changed file
with
51 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,21 +105,61 @@ For example, you could change the theme of the diagram, | |
using 'dark' instead of the default one. | ||
Simply add those arguments in the config file, e.g. | ||
|
||
|
||
```yaml | ||
plugins: | ||
- search | ||
- mermaid2: | ||
version: '10.1.0' | ||
arguments: | ||
- search | ||
- mermaid2: | ||
version: '10.1.0' | ||
arguments: | ||
theme: 'dark' | ||
themeVariables: | ||
primaryColor: '#BB2528' | ||
primaryTextColor: '#fff' | ||
primaryBorderColor: '#7C0000' | ||
lineColor: '#F8B229' | ||
secondaryColor: '#006100' | ||
tertiaryColor: '#fff' | ||
primaryColor: '#BB2528' | ||
primaryTextColor: '#fff' | ||
primaryBorderColor: '#7C0000' | ||
lineColor: '#F8B229' | ||
secondaryColor: '#006100' | ||
tertiaryColor: '#fff' | ||
``` | ||
|
||
The plugin then automatically adds the initialization sequence: | ||
|
||
=== "mermaid.js >= 10.0" | ||
|
||
Both `import` and `mermaid.initialize()` must be in the same `<script>` | ||
tag. | ||
|
||
```html | ||
<script type="module">import mermaid from "https://unpkg.com/[email protected]/dist/mermaid.esm.min.mjs"; | ||
mermaid.initialize({ | ||
theme: "dark", | ||
themeVariables: { | ||
primaryColor: "#BB2528", | ||
primaryTextColor: "#fff", | ||
primaryBorderColor: "#7C0000", | ||
lineColor: "#F8B229", | ||
secondaryColor: "#006100", | ||
tertiaryColor: "#fff" | ||
} | ||
}); | ||
</script> | ||
``` | ||
=== "Earlier versions" | ||
|
||
=== "Earlier versions" | ||
For versions of mermaid.js < 10, **two** calls to the `<script>` tag are required. | ||
|
||
```html | ||
<script src="https://unpkg.com/[email protected]/dist/mermaid.min.js"></script> | ||
<script>mermaid.initialize({ | ||
theme: "dark", | ||
themeVariables: { | ||
primaryColor: "#BB2528", | ||
primaryTextColor: "#fff", | ||
primaryBorderColor: "#7C0000", | ||
lineColor: "#F8B229", | ||
secondaryColor: "#006100", | ||
tertiaryColor: "#fff" | ||
} | ||
}); | ||
</script> | ||
``` |