mermaid-rs-renderer

(β˜… 1,662)

A fast native Rust Mermaid diagram renderer. No browser required. 500-1000x faster than mermaid-cli.

  • .gitignore
  • Cargo.lock
  • Cargo.toml
  • CHANGELOG.md
  • clippy.toml
  • flake.lock
  • flake.nix
  • LICENSE
  • package-lock.json
  • package.json
  • README.md

πŸš€ Installation Guide

1. Get the code
git clone https://github.com/1jehuang/mermaid-rs-renderer

Downloads the entire project code from GitHub to your computer.

cd mermaid-rs-renderer

Moves into the project folder you just downloaded.

2. Official Install Script

Easy Recommended
Prerequisites
cargo install mermaid-rs-renderer

Builds and installs the package published on crates.io β€” no need to clone the repo yourself.

cargo install --path .

Type this command into your terminal and run it.

brew tap 1jehuang/mmdr && brew install mmdr

Registers this project's repository (tap) with Homebrew.

βœ… After installing, open a new terminal and run the program's version command (e.g. --version) to confirm it worked.

Pulled directly from this repo's README.

3. Node.js

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Node.js Node.js must be installed to use npm. The LTS version is recommended.
npm install

Downloads and installs the libraries listed in package.json.

npm start

Starts the development/run server.

βœ… After running the command, open the address shown in the terminal (usually something like http://localhost:3000) in your browser.

4. Rust

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Rust (rustup) Installing via rustup also installs cargo.
cargo install mermaid-rs-renderer

Builds and installs the package published on crates.io β€” no need to clone the repo yourself.

cargo install --path .

Type this command into your terminal and run it.

cargo test

Type this command into your terminal and run it.

cargo run -- -i docs/diagrams/architecture.mmd -o target/out.svg -e svg

Builds and then immediately runs the program.

scripts/remote-cargo.sh test

Type this command into your terminal and run it.

βœ… If cargo build finishes without errors, it worked. The executable is created under target/.

Pulled directly from this repo's README.

// repository documentation