SimonKenyonShepard / mermaidjs-github-svg-generator

This project allows you to generate and render mermaidJS diagrams and automatically include them in github README files
Mozilla Public License 2.0
62 stars 37 forks source link

Github mermaidJS SVG diagram generator

This project allows you to generate and render mermaidJS diagrams and automatically include them in github README files

Background

I found myself in the scenario where I needed to document a software system using sequence diagrams. After discussing the matter with other engineers I consolidated the following requirements :

Tech choices

After some trial and error experimentation based on these requirements, I landed with the following tech choices :

Requirements

NodeJS & NPM

Installation

In order to start modifying & rendering sequence diagrams for consumption in Github Readme's you need to first run :

npm install

Usage

To create or modify a sequence diagram, you first need to create a folder in the src directory and create a mermaid markdown file to render.

mkdir src/[your sequence diagram folder]
touch src/[your sequence diagram folder]/[yourSequenceDiagramCode].mmd

Once this is done you can simply run :

npm run build

and in the "rendered" folder you should find a subfolder with your chosen name and inside a README.md with your sequence diagram and the SVG sequence diagram itself.

Examples

  1. githubSequenceDiagrams
  2. testFlowDiagram