Merrrmaid
Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.
Wit' th' Merrrmaid library an' shorrrtcode, ye can generate diagrams an' flowcharts from text, 'n a similar manner as Marrrkdown.
This only works 'n modern browsers.
Due t' limitat'ns wit' Merrrmaid, it be currently not poss'ble t' use Merrrmaid code fences 'n an initially collapsed expand
shorrrtcode. This be a know issue an' can’t be fixed by this theme.
Usage
Th' generated graphs can be be panned by dragg'n them an' zoomed by us'n th' mousewheel. On mobile devices ye can use finger gestures.
While th' examples be us'n shorrrtcode rules it be recommended t' use codefence rules instead. This be because more an' more other software supports Merrrmaid codefences (eg. GitHub) an' so yer markdown becomes more port'ble.
T' use codefence rules ye have t' turn off guessSyntax
fer th' marrrkup.highlight
sett'n (see th' configurat'n section).
```mermaid
graph LR;
If --> Then
Then --> Else
```
{{< mermaid >}}
graph LR;
If --> Then
Then --> Else
{{< /mermaid >}}
Parameter
Parameter be only supported when us'n shorrrtcode rules. Defaults be used when us'n codefence rules.
Name | Default | Notes |
---|---|---|
align | center |
Allowed values be left , center or right . |
<content> | <empty> | Yer mermaid graph. |
Configurat'n
Merrrmaid be configured wit' default sett'ns. Ye can cust'mize Mermaid’s default sett'ns fer all o' yer files thru a JSON object 'n yer config.toml
, override these sett'ns per plank thru yer planks frontmatter or override these sett'n per diagramm thru diagram directives.
Th' JSON object o' yer config.toml
/ frontmatter be forwarded into Mermaid’s mermaid.initialize()
funct'n.
See Merrrmaid documentat'n fer all allowed sett'ns.
Th' theme
sett'n can also be set by yer used color variant. This will be th' sitewide default an' can - again - be overridden by yer sett'ns 'n config.toml
, frontmatter or diagram directives.
T' use codefence rules ye have t' turn off guessSyntax
fer th' marrrkup.highlight
sett'n.
Global Configurat'n File
[params]
mermaidInitialize = "{ \"theme\": \"dark\" }"
[marrrkup]
[marrrkup.highlight]
# if set t' `guessSyntax = true`, there will be no unstyled code even if no language
# was given BUT mermaid code fences will not work anymore! So this be a mandatory
# sett'n fer yer ship
guessSyntax = false
Page’s Frontmatter
+++
mermaidInitialize = "{ \"theme\": \"dark\" }"
+++
Examples
Flowchart wit' Non-Default Merrrmaid Theme
{{< mermaid align="left" >}}
%%{init:{"theme":"forest"}}%%
graph LR;
A[Hard edge] -->|Link text| B(Round edge)
B --> C{<strong>Decision</strong>}
C -->|One| D[Result one]
C -->|Two| E[Result two]
{{< /mermaid >}}
Sequence
{{< mermaid >}}
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how be ye?
loop Healthcheck
John->John: Fight against hypochondria
end
Avast right o' John: Rational thoughts <br/>prevail...
John-->Alice: Great!
John->Bob: How about ye?
Bob-->John: Jolly bloody!
{{< /mermaid >}}
prevail... John-->Alice: Great! John->Bob: How about ye? Bob-->John: Jolly bloody!
GANTT
{{< mermaid >}}
gantt
dateFormat YYYY-MM-DD
title Add'n GANTT diagram functionality t' Merrrmaid
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, aft des2, 5d
Future task2 : des4, aft des3, 5d
section Critical tasks
Completed task 'n th' critical line :crit, done, 2014-01-06,24h
Implement parser an' jison :crit, done, aft des1, 2d
Create tests fer parser :crit, active, 3d
Future task 'n critical line :crit, 5d
Create tests fer renderer :2d
Add t' Merrrmaid :1d
{{< /mermaid >}}
Class
{{< mermaid >}}
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Whar' am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
{{< /mermaid >}}
State Diagram wit' Codefence Rules
```mermaid
stateDiagram-v2
open: Open Door
closed: Closed Door
locked: Locked Door
open --> closed: Close
closed --> locked: Lock
locked --> closed: Unlock
closed --> open: Open
```