From the Mind of Bob

What I think, what I hear, what I see

Mermaid Test

2023-07-01 test mermaid Bob Ossler

Using Mermaid in Hugo

I am trying out the mermaid markdown-like syntax for creating code diagrams, graphs, and pie charts.

Graph L-R

graph LR; Root-->A & B & C A-->A1-->A2--->A3 B-->B1-->B2-->B3 C--->C1-->C2-->C3

Graph Top-Down

graph TD; A-->B; A-->C; B-->D; C-->D;

Pie Chart

pie title Linux Distributions "Debian":42.96 "Ubuntu":50.05 "Arch":10.01 "CentOS":5

Flowchart

flowchart TD; A[Choose OS] --> B{Do you want?} B -- Yes --> C[UNIX or Windows] C -- Windows --> D[Good Luck!] C -- UNIX --> E{Linux or macOS} E -- Linux --> G{Good Choice!} E -- macOS --> H{apple.com} B -- No ---> F[End]

And that’s only a few examples of what can be done using mermaid. I pulled these examples out of an article I read in Ultimate Linux Projects, Issue 2, written by Mihalis Tsoukalos. I had to make several corrections to the mermaid syntax provided by the author; possibly because of mermaid version changes.

There are many more shapes available, as well as styling text. There are also themes available, but I haven’t tried any yet.