Test /
PmSyntax-MermaidJS
This is one possible way to configure $CustomSyntax
(Cookbook:CustomSyntax) for Cookbook:MermaidJs.
Note, the full recipe is not included here, only the $CustomSyntax
configuration is enabled.
$CustomSyntax
SDVA($CustomSyntax, array(
'Mermaid,1' => "<ws0 =directive>=meta_nobg>=meta_nobg>=comment>attr>punct>keyword>keyword>*attr
/(\(:mermaid)(.*?)(:\))([\s\S]*?)(\(:mermaidend:\))/g
/(%%|\|)(.*?)(\\1)/g
/^( *(?:style|title|dateFormat|exludes|axisFormat) )(.*)/mg
/(%%)(.*)$/mg
/\\bfa:fa-[-a-z]+/g
/[(){}[\]\/:]+/g
/\\b(?:(?:sub)?graph|flowchart|journey|gantt|pie|section|(?:sequence|class|state|er)Diagram|(?:de)?activate|alt|else|opt|par|and)\\b/g
/\\b(?:classDef|participant|actor|loop|end|Note|right|left|direction|click|href|rect|link)\\b/g
/[-=|.<>+]{2,}/g
",
));
Playground
(:mermaid id=dom class=petko:)
graph LR
A[Start Project] --> B{Do things<br> right or do<br> them fast?}
B --> C[Code<br>well] --> D{Are<br>you done<br>yet?}
B --> E[Code<br>fast] --> F{Does<br>it work<br>yet?}
D --> C
D --> G[Throw it all out<br>and start over]
F --> E
F --> G
G --> B
H((?)) --> I[Good Code]
(:mermaidend:)
|
(:mermaid:)
gantt
%% this is a comment
section Section
A task :a1, 2014-01-01, 30d
Another task :after a1 , 20d
section Another
Task in sec :2014-01-12 , 12d
another task : 24d
(:mermaidend:)
|
(:mermaid:)
sequenceDiagram
Note right of John: Text in note
Alice->>+John: Hello John, how are you?
activate John
John-->>-Alice: Great!
deactivate John
(:mermaidend:)
|
(:mermaid:)
flowchart TB
%% this is a comment A -- text --> B{node}
B["fa:fa-twitter for peace"]
B-->C[fa:fa-ban forbidden]
B-->D(fa:fa-spinner);
B-->E(A fa:fa-camera-retro perhaps?);
A:::someclass --> B
classDef someclass fill:#f96;
(:mermaidend:)
|
(:mermaid:)
flowchart TB
id1(Start)-->id2(Stop)
c1-->a2
subgraph one
a1-->a2
end
subgraph two
b1-->b2
end
subgraph three
c1-->c2
end
one --> two
three --> two
two --> c2
(:mermaidend:)
|
(:mermaid:)
graph TD
A[Christmas] --> B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==> D[Laptop]
C --> E[iPhone]
C --> F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
(:mermaidend:)
|