mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
docs: show additional Mermaid graphs #394
and reorder diagram types in Mermaid docs order
This commit is contained in:
parent
0d5ee6d1b4
commit
1fd26744c6
1 changed files with 212 additions and 83 deletions
|
@ -135,6 +135,36 @@ graph LR;
|
||||||
C -->|Two| E[Result two]
|
C -->|Two| E[Result two]
|
||||||
{{< /mermaid >}}
|
{{< /mermaid >}}
|
||||||
|
|
||||||
|
### Sequence Diagram with Configuration Directive
|
||||||
|
|
||||||
|
````go
|
||||||
|
{{</* mermaid */>}}
|
||||||
|
%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
|
||||||
|
sequenceDiagram
|
||||||
|
Alice->>John: Hello John, how are you?
|
||||||
|
loop Healthcheck
|
||||||
|
John->>John: Fight against hypochondria
|
||||||
|
end
|
||||||
|
Note right of John: Rational thoughts!
|
||||||
|
John-->>Alice: Great!
|
||||||
|
John->>Bob: How about you?
|
||||||
|
Bob-->>John: Jolly good!
|
||||||
|
{{</* /mermaid */>}}
|
||||||
|
````
|
||||||
|
|
||||||
|
{{< mermaid >}}
|
||||||
|
%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
|
||||||
|
sequenceDiagram
|
||||||
|
Alice->>John: Hello John, how are you?
|
||||||
|
loop Healthcheck
|
||||||
|
John->>John: Fight against hypochondria
|
||||||
|
end
|
||||||
|
Note right of John: Rational thoughts!
|
||||||
|
John-->>Alice: Great!
|
||||||
|
John->>Bob: How about you?
|
||||||
|
Bob-->>John: Jolly good!
|
||||||
|
{{< /mermaid >}}
|
||||||
|
|
||||||
### Class Diagram with Codefence Syntax
|
### Class Diagram with Codefence Syntax
|
||||||
|
|
||||||
````go
|
````go
|
||||||
|
@ -213,79 +243,6 @@ stateDiagram-v2
|
||||||
closed --> open: Open
|
closed --> open: Open
|
||||||
{{< /mermaid >}}
|
{{< /mermaid >}}
|
||||||
|
|
||||||
### Sequence Diagram
|
|
||||||
|
|
||||||
````go
|
|
||||||
{{</* mermaid */>}}
|
|
||||||
sequenceDiagram
|
|
||||||
participant Alice
|
|
||||||
participant Bob
|
|
||||||
Alice->>John: Hello John, how are you?
|
|
||||||
loop Healthcheck
|
|
||||||
John->John: Fight against hypochondria
|
|
||||||
end
|
|
||||||
Note right of John: Rational thoughts <br>prevail...
|
|
||||||
John-->Alice: Great!
|
|
||||||
John->Bob: How about you?
|
|
||||||
Bob-->John: Jolly good!
|
|
||||||
{{</* /mermaid */>}}
|
|
||||||
````
|
|
||||||
|
|
||||||
{{< mermaid >}}
|
|
||||||
sequenceDiagram
|
|
||||||
participant Alice
|
|
||||||
participant Bob
|
|
||||||
Alice->>John: Hello John, how are you?
|
|
||||||
loop Healthcheck
|
|
||||||
John->John: Fight against hypochondria
|
|
||||||
end
|
|
||||||
Note right of John: Rational thoughts <br>prevail...
|
|
||||||
John-->Alice: Great!
|
|
||||||
John->Bob: How about you?
|
|
||||||
Bob-->John: Jolly good!
|
|
||||||
{{< /mermaid >}}
|
|
||||||
|
|
||||||
### GANTT Chart
|
|
||||||
|
|
||||||
````go
|
|
||||||
{{</* mermaid */>}}
|
|
||||||
gantt
|
|
||||||
dateFormat YYYY-MM-DD
|
|
||||||
title Adding GANTT diagram functionality to Mermaid
|
|
||||||
section A section
|
|
||||||
Completed task :done, des1, 2014-01-06,2014-01-08
|
|
||||||
Active task :active, des2, 2014-01-09, 3d
|
|
||||||
Future task : des3, after des2, 5d
|
|
||||||
Future task2 : des4, after des3, 5d
|
|
||||||
section Critical tasks
|
|
||||||
Completed task in the critical line :crit, done, 2014-01-06,24h
|
|
||||||
Implement parser and jison :crit, done, after des1, 2d
|
|
||||||
Create tests for parser :crit, active, 3d
|
|
||||||
Future task in critical line :crit, 5d
|
|
||||||
Create tests for renderer :2d
|
|
||||||
Add to Mermaid :1d
|
|
||||||
{{</* /mermaid */>}}
|
|
||||||
````
|
|
||||||
|
|
||||||
{{< mermaid >}}
|
|
||||||
gantt
|
|
||||||
dateFormat YYYY-MM-DD
|
|
||||||
title Adding GANTT diagram functionality to Mermaid
|
|
||||||
section A section
|
|
||||||
Completed task :done, des1, 2014-01-06,2014-01-08
|
|
||||||
Active task :active, des2, 2014-01-09, 3d
|
|
||||||
Future task : des3, after des2, 5d
|
|
||||||
Future task2 : des4, after des3, 5d
|
|
||||||
section Critical tasks
|
|
||||||
Completed task in the critical line :crit, done, 2014-01-06,24h
|
|
||||||
Implement parser and jison :crit, done, after des1, 2d
|
|
||||||
Create tests for parser :crit, active, 3d
|
|
||||||
Future task in critical line :crit, 5d
|
|
||||||
Create tests for renderer :2d
|
|
||||||
Add to Mermaid :1d
|
|
||||||
{{< /mermaid >}}
|
|
||||||
|
|
||||||
|
|
||||||
### Entity Relationship Model
|
### Entity Relationship Model
|
||||||
|
|
||||||
````go
|
````go
|
||||||
|
@ -342,6 +299,102 @@ journey
|
||||||
Sit down: 3: Me
|
Sit down: 3: Me
|
||||||
{{< /mermaid >}}
|
{{< /mermaid >}}
|
||||||
|
|
||||||
|
### GANTT Chart
|
||||||
|
|
||||||
|
````go
|
||||||
|
{{</* mermaid */>}}
|
||||||
|
gantt
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
title Adding GANTT diagram functionality to Mermaid
|
||||||
|
section A section
|
||||||
|
Completed task :done, des1, 2014-01-06,2014-01-08
|
||||||
|
Active task :active, des2, 2014-01-09, 3d
|
||||||
|
Future task : des3, after des2, 5d
|
||||||
|
Future task2 : des4, after des3, 5d
|
||||||
|
section Critical tasks
|
||||||
|
Completed task in the critical line :crit, done, 2014-01-06,24h
|
||||||
|
Implement parser and jison :crit, done, after des1, 2d
|
||||||
|
Create tests for parser :crit, active, 3d
|
||||||
|
Future task in critical line :crit, 5d
|
||||||
|
Create tests for renderer :2d
|
||||||
|
Add to Mermaid :1d
|
||||||
|
{{</* /mermaid */>}}
|
||||||
|
````
|
||||||
|
|
||||||
|
{{< mermaid >}}
|
||||||
|
gantt
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
title Adding GANTT diagram functionality to Mermaid
|
||||||
|
section A section
|
||||||
|
Completed task :done, des1, 2014-01-06,2014-01-08
|
||||||
|
Active task :active, des2, 2014-01-09, 3d
|
||||||
|
Future task : des3, after des2, 5d
|
||||||
|
Future task2 : des4, after des3, 5d
|
||||||
|
section Critical tasks
|
||||||
|
Completed task in the critical line :crit, done, 2014-01-06,24h
|
||||||
|
Implement parser and jison :crit, done, after des1, 2d
|
||||||
|
Create tests for parser :crit, active, 3d
|
||||||
|
Future task in critical line :crit, 5d
|
||||||
|
Create tests for renderer :2d
|
||||||
|
Add to Mermaid :1d
|
||||||
|
{{< /mermaid >}}
|
||||||
|
|
||||||
|
### Pie Chart
|
||||||
|
|
||||||
|
````go
|
||||||
|
{{</* mermaid */>}}
|
||||||
|
pie title Pets adopted by volunteers
|
||||||
|
"Dogs" : 386
|
||||||
|
"Cats" : 85
|
||||||
|
"Rats" : 15
|
||||||
|
{{</* /mermaid */>}}
|
||||||
|
````
|
||||||
|
|
||||||
|
{{< mermaid >}}
|
||||||
|
pie title Pets adopted by volunteers
|
||||||
|
"Dogs" : 386
|
||||||
|
"Cats" : 85
|
||||||
|
"Rats" : 15
|
||||||
|
{{< /mermaid >}}
|
||||||
|
|
||||||
|
### Requirement Diagram
|
||||||
|
|
||||||
|
````go
|
||||||
|
{{</* mermaid */>}}
|
||||||
|
requirementDiagram
|
||||||
|
|
||||||
|
requirement test_req {
|
||||||
|
id: 1
|
||||||
|
text: the test text.
|
||||||
|
risk: high
|
||||||
|
verifymethod: test
|
||||||
|
}
|
||||||
|
|
||||||
|
element test_entity {
|
||||||
|
type: simulation
|
||||||
|
}
|
||||||
|
|
||||||
|
test_entity - satisfies -> test_req
|
||||||
|
{{</* /mermaid */>}}
|
||||||
|
````
|
||||||
|
|
||||||
|
{{< mermaid >}}
|
||||||
|
requirementDiagram
|
||||||
|
|
||||||
|
requirement test_req {
|
||||||
|
id: 1
|
||||||
|
text: the test text.
|
||||||
|
risk: high
|
||||||
|
verifymethod: test
|
||||||
|
}
|
||||||
|
|
||||||
|
element test_entity {
|
||||||
|
type: simulation
|
||||||
|
}
|
||||||
|
|
||||||
|
test_entity - satisfies -> test_req
|
||||||
|
{{< /mermaid >}}
|
||||||
|
|
||||||
### Git Graph
|
### Git Graph
|
||||||
|
|
||||||
````go
|
````go
|
||||||
|
@ -374,28 +427,104 @@ gitGraph
|
||||||
commit
|
commit
|
||||||
{{< /mermaid >}}
|
{{< /mermaid >}}
|
||||||
|
|
||||||
### Pie Chart
|
### C4 Diagrams
|
||||||
|
|
||||||
````go
|
````go
|
||||||
{{</* mermaid */>}}
|
{{</* mermaid */>}}
|
||||||
pie title Pets adopted by volunteers
|
C4Context
|
||||||
"Dogs" : 386
|
title System Context diagram for Internet Banking System
|
||||||
"Cats" : 85
|
Enterprise_Boundary(b0, "BankBoundary0") {
|
||||||
"Rats" : 15
|
Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
|
||||||
|
Person(customerB, "Banking Customer B")
|
||||||
|
Person_Ext(customerC, "Banking Customer C", "desc")
|
||||||
|
|
||||||
|
Person(customerD, "Banking Customer D", "A customer of the bank, <br/> with personal bank accounts.")
|
||||||
|
|
||||||
|
System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
|
||||||
|
|
||||||
|
Enterprise_Boundary(b1, "BankBoundary") {
|
||||||
|
|
||||||
|
SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
|
||||||
|
|
||||||
|
System_Boundary(b2, "BankBoundary2") {
|
||||||
|
System(SystemA, "Banking System A")
|
||||||
|
System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts. next line.")
|
||||||
|
}
|
||||||
|
|
||||||
|
System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
|
||||||
|
SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")
|
||||||
|
|
||||||
|
Boundary(b3, "BankBoundary3", "boundary") {
|
||||||
|
SystemQueue(SystemF, "Banking System F Queue", "A system of the bank.")
|
||||||
|
SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BiRel(customerA, SystemAA, "Uses")
|
||||||
|
BiRel(SystemAA, SystemE, "Uses")
|
||||||
|
Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
|
||||||
|
Rel(SystemC, customerA, "Sends e-mails to")
|
||||||
|
|
||||||
|
UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
|
||||||
|
UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
|
||||||
|
UpdateRelStyle(SystemAA, SystemE, $textColor="blue", $lineColor="blue", $offsetY="-10")
|
||||||
|
UpdateRelStyle(SystemAA, SystemC, $textColor="blue", $lineColor="blue", $offsetY="-40", $offsetX="-50")
|
||||||
|
UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")
|
||||||
|
|
||||||
|
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
|
||||||
{{</* /mermaid */>}}
|
{{</* /mermaid */>}}
|
||||||
````
|
````
|
||||||
|
|
||||||
{{< mermaid >}}
|
{{< mermaid >}}
|
||||||
pie title Pets adopted by volunteers
|
C4Context
|
||||||
"Dogs" : 386
|
title System Context diagram for Internet Banking System
|
||||||
"Cats" : 85
|
Enterprise_Boundary(b0, "BankBoundary0") {
|
||||||
"Rats" : 15
|
Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
|
||||||
|
Person(customerB, "Banking Customer B")
|
||||||
|
Person_Ext(customerC, "Banking Customer C", "desc")
|
||||||
|
|
||||||
|
Person(customerD, "Banking Customer D", "A customer of the bank, <br/> with personal bank accounts.")
|
||||||
|
|
||||||
|
System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
|
||||||
|
|
||||||
|
Enterprise_Boundary(b1, "BankBoundary") {
|
||||||
|
|
||||||
|
SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
|
||||||
|
|
||||||
|
System_Boundary(b2, "BankBoundary2") {
|
||||||
|
System(SystemA, "Banking System A")
|
||||||
|
System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts. next line.")
|
||||||
|
}
|
||||||
|
|
||||||
|
System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
|
||||||
|
SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")
|
||||||
|
|
||||||
|
Boundary(b3, "BankBoundary3", "boundary") {
|
||||||
|
SystemQueue(SystemF, "Banking System F Queue", "A system of the bank.")
|
||||||
|
SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BiRel(customerA, SystemAA, "Uses")
|
||||||
|
BiRel(SystemAA, SystemE, "Uses")
|
||||||
|
Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
|
||||||
|
Rel(SystemC, customerA, "Sends e-mails to")
|
||||||
|
|
||||||
|
UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
|
||||||
|
UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
|
||||||
|
UpdateRelStyle(SystemAA, SystemE, $textColor="blue", $lineColor="blue", $offsetY="-10")
|
||||||
|
UpdateRelStyle(SystemAA, SystemC, $textColor="blue", $lineColor="blue", $offsetY="-40", $offsetX="-50")
|
||||||
|
UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")
|
||||||
|
|
||||||
|
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
|
||||||
{{< /mermaid >}}
|
{{< /mermaid >}}
|
||||||
|
|
||||||
### Mindmap
|
### Mindmap
|
||||||
|
|
||||||
{{% notice note %}}
|
{{% notice note %}}
|
||||||
This diagram type seems to be broken in the way this theme uses Mermaid. This will probably be fixed in the future by the Mermaid team.
|
As of Mermaid version 9.2.2 this diagram type is not included in the official distribution and will not be useable in this theme.
|
||||||
{{% /notice %}}
|
{{% /notice %}}
|
||||||
|
|
||||||
````go
|
````go
|
||||||
|
|
Loading…
Reference in a new issue