mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
clarify caveats for mermaid code fences
This commit is contained in:
parent
a2fa096c3e
commit
fdd5ff7ab8
3 changed files with 13 additions and 7 deletions
|
@ -26,7 +26,7 @@ relativeURLs = true
|
|||
[markup]
|
||||
[markup.highlight]
|
||||
style = "base16-snazzy" # choose a color theme or create your own
|
||||
guessSyntax = true # avoid unstyled code if no language was given
|
||||
guessSyntax = false # if set to true, avoid unstyled code if no language was given but mermaid code fences will not work anymore
|
||||
|
||||
[markup.goldmark.renderer]
|
||||
unsafe= true
|
||||
|
|
|
@ -57,5 +57,5 @@ You can choose a color theme from the [list of supported themes](https://xyproto
|
|||
[markup]
|
||||
[markup.highlight]
|
||||
style = "base16-snazzy" # choose a color theme or create your own
|
||||
guessSyntax = true # avoid unstyled code if no language was given
|
||||
guessSyntax = false # if set to true, avoid unstyled code if no language was given but mermaid code fences will not work anymore
|
||||
````
|
||||
|
|
|
@ -18,7 +18,7 @@ classDiagram
|
|||
|
||||
You can set an optional `align` attribute which defaults to `center`.
|
||||
|
||||
If you don't need alignment you can use the alternative syntax using code fences:
|
||||
If you don't need alignment you can use the alternative syntax using code fences if you have turned off `guessSyntax` for the `markup.highlight` setting (see below):
|
||||
|
||||
````plaintext
|
||||
```mermaid
|
||||
|
@ -171,7 +171,7 @@ classDiagram
|
|||
|
||||
### State
|
||||
|
||||
{{< mermaid >}}
|
||||
````mermaid
|
||||
stateDiagram-v2
|
||||
open: Open Door
|
||||
closed: Closed Door
|
||||
|
@ -180,11 +180,11 @@ stateDiagram-v2
|
|||
closed --> locked: Lock
|
||||
locked --> closed: Unlock
|
||||
closed --> open: Open
|
||||
{{< /mermaid >}}
|
||||
````
|
||||
|
||||
{{% expand "Show markup" "true" %}}
|
||||
````go
|
||||
{{</* mermaid */>}}
|
||||
```mermaid
|
||||
stateDiagram-v2
|
||||
open: Open Door
|
||||
closed: Closed Door
|
||||
|
@ -193,7 +193,7 @@ stateDiagram-v2
|
|||
closed --> locked: Lock
|
||||
locked --> closed: Unlock
|
||||
closed --> open: Open
|
||||
{{</* /mermaid */>}}
|
||||
```
|
||||
````
|
||||
{{% /expand %}}
|
||||
|
||||
|
@ -205,11 +205,17 @@ This JSON object is forwarded into Mermaid's `mermaid.initialize()` function.
|
|||
|
||||
See [Mermaid documentation](http://mermaid-js.github.io/mermaid/getting-started/Setup.html#mermaidapi-configuration-defaults) for all allowed settings.
|
||||
|
||||
Also, if you want to use mermaid codefences, you have to turn off `guessSyntax` for the `markup.highlight` setting.
|
||||
|
||||
### Example
|
||||
|
||||
````toml
|
||||
[params]
|
||||
mermaidInitialize = "{ \"theme\": \"dark\" }"
|
||||
|
||||
[markup]
|
||||
[markup.highlight]
|
||||
guessSyntax = false # if set to true, avoid unstyled code if no language was given but mermaid code fences will not work anymore
|
||||
````
|
||||
|
||||
or pages frontmatter
|
||||
|
|
Loading…
Reference in a new issue