@@ -8,6 +8,7 @@ description : "Generation of diagram and flowchart from text in a similar manner
88Just insert your mermaid code in the ` mermaid ` shortcode and that's it.
99
1010## Flowchart example
11+
1112 {{</*mermaid align="left"*/>}}
1213 graph LR;
1314 A[Hard edge] -->|Link text| B(Round edge)
@@ -26,6 +27,28 @@ graph LR;
2627 C -->|Two| E[ Result two]
2728{{< /mermaid >}}
2829
30+ or you can use this alternative syntax:
31+
32+ <pre >
33+ ```mermaid
34+ graph LR;
35+ A[Hard edge] -->|Link text| B(Round edge)
36+ B --> C{Decision}
37+ C -->|One| D[Result one]
38+ C -->|Two| E[Result two]
39+ ```
40+ </pre >
41+
42+ renders as
43+
44+ ``` mermaid
45+ graph LR;
46+ A[Hard edge] -->|Link text| B(Round edge)
47+ B --> C{Decision}
48+ C -->|One| D[Result one]
49+ C -->|Two| E[Result two]
50+ ```
51+
2952## Sequence example
3053
3154 {{</*mermaid*/>}}
@@ -58,6 +81,40 @@ sequenceDiagram
5881 Bob-->John: Jolly good!
5982{{< /mermaid >}}
6083
84+ or you can use this alternative syntax:
85+
86+ <pre >
87+ ```mermaid
88+ sequenceDiagram
89+ participant Alice
90+ participant Bob
91+ Alice->>John: Hello John, how are you?
92+ loop Healthcheck
93+ John->John: Fight against hypochondria
94+ end
95+ Note right of John: Rational thoughts <br />prevail...
96+ John-->Alice: Great!
97+ John->Bob: How about you?
98+ Bob-->John: Jolly good!
99+ ```
100+ </pre >
101+
102+ renders as
103+
104+ ``` mermaid
105+ sequenceDiagram
106+ participant Alice
107+ participant Bob
108+ Alice->>John: Hello John, how are you?
109+ loop Healthcheck
110+ John->John: Fight against hypochondria
111+ end
112+ Note right of John: Rational thoughts <br/>prevail...
113+ John-->Alice: Great!
114+ John->Bob: How about you?
115+ Bob-->John: Jolly good!
116+ ```
117+
61118## GANTT Example
62119
63120 {{</*mermaid*/>}}
@@ -79,7 +136,7 @@ sequenceDiagram
79136 {{</* /mermaid */>}}
80137
81138
82- render as
139+ renders as
83140
84141{{<mermaid >}}
85142gantt
@@ -99,5 +156,128 @@ gantt
99156 Add to mermaid :1d
100157{{</mermaid >}}
101158
159+ or you can use this alternative syntax:
102160
161+ <pre >
162+ ```mermaid
163+ gantt
164+ dateFormat YYYY-MM-DD
165+ title Adding GANTT diagram functionality to mermaid
166+ section A section
167+ Completed task :done, des1, 2014-01-06,2014-01-08
168+ Active task :active, des2, 2014-01-09, 3d
169+ Future task : des3, after des2, 5d
170+ Future task2 : des4, after des3, 5d
171+ section Critical tasks
172+ Completed task in the critical line :crit, done, 2014-01-06,24h
173+ Implement parser and jison :crit, done, after des1, 2d
174+ Create tests for parser :crit, active, 3d
175+ Future task in critical line :crit, 5d
176+ Create tests for renderer :2d
177+ Add to mermaid :1d
178+ ```
179+ </pre >
180+
181+ renders as
182+
183+ ``` mermaid
184+ gantt
185+ dateFormat YYYY-MM-DD
186+ title Adding GANTT diagram functionality to mermaid
187+ section A section
188+ Completed task :done, des1, 2014-01-06,2014-01-08
189+ Active task :active, des2, 2014-01-09, 3d
190+ Future task : des3, after des2, 5d
191+ Future task2 : des4, after des3, 5d
192+ section Critical tasks
193+ Completed task in the critical line :crit, done, 2014-01-06,24h
194+ Implement parser and jison :crit, done, after des1, 2d
195+ Create tests for parser :crit, active, 3d
196+ Future task in critical line :crit, 5d
197+ Create tests for renderer :2d
198+ Add to mermaid :1d
199+ ```
200+
201+ ### Class example
202+
203+ <pre >
204+ ```mermaid
205+ classDiagram
206+ Class01 <|-- AveryLongClass : Cool
207+ Class03 *-- Class04
208+ Class05 o-- Class06
209+ Class07 .. Class08
210+ Class09 --> C2 : Where am i?
211+ Class09 --* C3
212+ Class09 --|> Class07
213+ Class07 : equals()
214+ Class07 : Object[] elementData
215+ Class01 : size()
216+ Class01 : int chimp
217+ Class01 : int gorilla
218+ Class08 <--> C2: Cool label
219+ ```
220+ </pre >
221+
222+ renders as
223+
224+ ``` mermaid
225+ classDiagram
226+ Class01 <|-- AveryLongClass : Cool
227+ Class03 *-- Class04
228+ Class05 o-- Class06
229+ Class07 .. Class08
230+ Class09 --> C2 : Where am i?
231+ Class09 --* C3
232+ Class09 --|> Class07
233+ Class07 : equals()
234+ Class07 : Object[] elementData
235+ Class01 : size()
236+ Class01 : int chimp
237+ Class01 : int gorilla
238+ Class08 <--> C2: Cool label
239+ ```
240+
241+ ### Git example
242+
243+ <pre >
244+ ```mermaid
245+ gitGraph:
246+ options
247+ {
248+ "nodeSpacing": 150,
249+ "nodeRadius": 10
250+ }
251+ end
252+ commit
253+ branch newbranch
254+ checkout newbranch
255+ commit
256+ commit
257+ checkout master
258+ commit
259+ commit
260+ merge newbranch
261+ ```
262+ </pre >
263+
264+ renders as
103265
266+ ``` mermaid
267+ gitGraph:
268+ options
269+ {
270+ "nodeSpacing": 150,
271+ "nodeRadius": 10
272+ }
273+ end
274+ commit
275+ branch newbranch
276+ checkout newbranch
277+ commit
278+ commit
279+ checkout master
280+ commit
281+ commit
282+ merge newbranch
283+ ```
0 commit comments