Giter VIP home page Giter VIP logo

mermaider's Introduction

Mermaider

npm

Simply build Mermaid diagram SVGs based on Mardown files.

using mermaider

Install

npm install -g mermaider

Usage

Define Diagrams

First, create markdown files that contain the diagram definitions, using mermaid syntax.
The diargram definitions must be in a mermaid code fence.

Example: content of example-diagram.md

```mermaid
flowchart LR
  A --> B
  A --> C
  B --> D
  C --> D
```

Benifit of using markdown files: You can use plugins to highlight definitions and get diagram previews.
Here is an example, using Visual Studio Code:
example

Build Diagrams

Then simply run:

mermaider [options] <input> <output>

Example:

mermaider --all ./md-files ./svg-files

Arguments

  • input: The input directory where the MD files are.
  • output: The output directory where the diagrams will be saved.

Options

  • -a, --all: Re-build all diagrams. This will also build files that already exist (overwrite).
  • -d, --delete: Delete SVG files with no matching MD file.
  • -i, --img: Fix svg files to be included as img tag.
  • -u, --update: Like -a, but only where the md file is newer than the existing svg file.
  • -v, --verbose: Log files while beeing processed.
  • -h, --help: display help for command

ChangeLog

0.3.1

  • Just fixes my name

0.3.0

  • Features
    • deletion: with parameter -d svg files will be deleted, if there is no matching md file
  • Fixes
    • md file: leading and trailing contents before/after mermaid code fence caused mermaid syntax errors

0.2.0

  • Features
    • img compatibility: now you can pass -i or --img option to make svg files able to be included as img tag.
    • improved overwriting: --update only overwrites existing svg if md is newer.
  • Fixes
    • fixed typo: files already exists --> files already exist

0.1.0

Initial Version

License

MIT

mermaider's People

Contributors

johanna-herrmann avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.