Logo

dev-resources.site

for different kinds of informations.

Draw Diagrams in READMEs using Mermaid

Published at
9/16/2024
Categories
markdown
mermaid
documentation
Author
farisdurrani
Categories
3 categories in total
markdown
open
mermaid
open
documentation
open
Author
12 person written this
farisdurrani
open
Draw Diagrams in READMEs using Mermaid

The Markdown format is a blessing for documentation. While many are aware it can create headings, tables, text styles, and lists, not many know about extensions available to the basic Markup language. Today, we'll learn about Mermaid.js. This powerful yet simple diagramming tool speaks to the aspirations of Markdown format.

As a native tool in GitHub.com, any Mermaid syntax is displayed on your READMEs when viewed on the website.

Note: the native VS Code README display tool cannot render Mermaid diagrams. You have to install Yiyi Wang's Markdown Preview Enhanced extension to do so.

Link to examples (GitHub Gist)

https://gist.github.com/farisdurrani/cebe1c0c820dc8cd18501acd4a4a300c

Simple example

Write this on your README, and the following basic flowchart example will show up:





```mermaid
flowchart TD
    A([Start])
    --> B[Task 1]
    --> C[Task 2]
    --> D([End])
```




Enter fullscreen mode Exit fullscreen mode

Flowchart basic

Standard Flowchart

Here, we make things more complex by adding diverging paths and names on arrows.

Code for Standard Example

Standard Flowchart

Flowchart of git directories

Playing around with shapes and subgraphs... (see the GitHub Gist for full code)

Flowchart of git directories

Gitgraph

And a non-flowchart example. Mermaid has tonnes of these.

Gitgraph

Official Mermaid Documentation

https://mermaid.js.org

Playground

Use this to test what your Mermaid diagram will look like
https://mermaid.live/edit

Safe harbor statement

The information provided on this channel/article/story is solely intended for informational purposes and cannot be used as a part of any contractual agreement. The content does not guarantee the delivery of any material, code, or functionality, and should not be the sole basis for making purchasing decisions. The postings on this site are my own and do not necessarily reflect the views or work of Oracle or Mythics, LLC.

This work is licensed under a Creative Commons Attribution 4.0 International License.

mermaid Article's
30 articles in total
Favicon
LLM + Mermaid: How Modern Teams Create UML Diagrams Without Lucidchart
Favicon
Draw Diagrams in READMEs using Mermaid
Favicon
Diagram as Code with Mermaid
Favicon
Visualizing Cloud Designations with Mermaid
Favicon
Adding Mermaid diagrams to Astro MDX
Favicon
Mermaid Cheat Sheet for Markdown
Favicon
Mermaid Markdown
Favicon
simple mermaid builder in golang: support ER/sequence diagram, pie chart
Favicon
Why mermaid diagrams will be the next big thing in creating diagrams?
Favicon
HueHive diagram generator -Mermaid diagrams using ChatGPT
Favicon
Automating my Blog
Favicon
Technical presentations with Marp and Mermaid
Favicon
Convert YouTube videos into Mind Maps using ChatGPT
Favicon
Mastering Diagrams: A Professional Approach to Enhancing Visuals with ChatGPT and Mermaid
Favicon
Text to diagram
Favicon
Colouring Your Arrow / Link with `linkStyle` in Mermaid Markdown
Favicon
Creando diagramas con ChatGPT y Mermaid js
Favicon
Scaling Diagram Documentation
Favicon
Diagramming Finite State Machines with Mermaid.js
Favicon
Creating SysML Requirement Diagrams in Mermaid.js
Favicon
Creating Timeline Charts with Mermaid.js
Favicon
How to Make Flowcharts with Mermaid.js
Favicon
Mind Maps in Markdown with Mermaid.js
Favicon
Creating Gantt Charts with Markdown and Mermaid.js
Favicon
Mapping User Journeys with Mermaid.js
Favicon
Making Pie (Charts) out of Mermaid.js
Favicon
Illustrating git Branching with Markdown and Mermaid.js
Favicon
Sequence Diagrams in Markdown with Mermaid.js
Favicon
Text-Based Entity Relationship Diagrams with Mermaid.js
Favicon
Creating Class Diagrams with Mermaid.js

Featured ones: