• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Previews Mermaid diagrams

Mermaid diagram previewer for Visual Studio Code

Greenkeeper badge

The plugin enables live editing and visualization of mermaid supported diagrams.

Related plugins:

Usage

  1. Open a file containing Mermaid diagram
  2. Choose Preview Mermaid Diagram
  3. Move cursor inside the diagram

activate

usage

Supported formats

The plugin detects mermaid diagrams in the following formats:

HTML tag

<div class="mermaid">sequenceDiagram A-->B: Works!</div>

Markdown fenced code

```mermaid
sequenceDiagram
  A-->B: Works!
```

HUGO shortcodes

{{<mermaid attr="val">}} sequenceDiagram A-->B: Works! {{</mermaid>}}

Sphinx directives

.. mermaid:: :parameters: are optional sequenceDiagram A-->B: Works!

The plugin does not preview diagrams in external files:

.. mermaid:: graphs/mygraph.mmd

Standalone Mermaid files

Files with extension .mmd with plain Mermaid diagram content:

sequenceDiagram
  A-->B: Works!

FontAwesome support

The plugin aims to be on par with the Mermaid Live Editor on handling Font Awesome icons.

Minimap

Enabling/disabling minimap rendering is controlled with the minimap setting.

Customize diagrams

Rendering

You can customize the appearance of the previewed diagrams by setting the mermaid configuration in the workspace settings:

{
  "mermaid": {
    "sequenceDiagram": {
      "mirrorActors": false
    }
  }
}

All mermaid configuration options are supported.

Theme handling

Default values

Based on the theme used in Visual Studio Code, the plugin default themes are: forest for light and dark for dark. These values can be changed with the following settings:

{
  "mermaid.vscode.light": "one of default, forest, neutral, dark",
  "mermaid.vscode.dark": "one of default, forest, neutral, dark"
}

Overriding automatic light/dark selection

Automatic theme selection can be changed with the following setting:

{
  "mermaid.theme": "one of default, forest, neutral, dark"
}

Custom theme

You can render the diagram using a custom theme by providing the following configuration properties:

{
  "mermaid.theme": null,
  "mermaid.themeCSS": "the theme as string"
}

⚠️ The value null for theme disables the automatic theme detection, so you are responsible for providing a proper theme in themeCSS for all diagrams used in the settings' scope.

More Repositories

1

fsm-as-promised

A finite state machine library using ES6 promises
JavaScript
460
star
2

InstagramPlugin

Instagram plugin for PhoneGap/Cordova
Objective-C
120
star
3

ZeroConf

ZeroConf plugin for Cordova/Phonegap 3.0
Java
39
star
4

PromisesPlugin

ES6-Promises polyfill for Cordova/PhoneGap
Shell
26
star
5

fsm-viewer

View finite state machines using fsm-as-promised library as UML diagrams in VSCode
JavaScript
23
star
6

mongoose-jsonschema

Mongoose schema to JSON schema and back
JavaScript
11
star
7

fsm2dot

Convert javascript state machine to UML diagram
JavaScript
11
star
8

dtmf

Experimenting with Web Audio API
JavaScript
8
star
9

instagramplugin-example

Basic Cordova application that demonstrates the use of InstagramPlugin
CSS
6
star
10

regio

Minimalist web framework with express-like aspirations
JavaScript
5
star
11

espruinofy

Browserify plugin for creating Espruino runnable bundles
JavaScript
3
star
12

GamepadButtons

Gamepad API polyfill for Cordova/PhoneGap on Android gamepads
Java
3
star
13

vscode-fsm-as-promised

Viewer for fsm-as-promised defined state machines
TypeScript
1
star
14

generator-kore

A browserify based workflow for knockout.js applications
JavaScript
1
star
15

vscode-supermodel-test

Makefile
1
star
16

writethelirycs

1
star
17

chai-as-typed

Chai assertions for types defined via JSDoc
JavaScript
1
star
18

regio-camera

Regio middleware for Tessel camera module
JavaScript
1
star
19

cordova-plugin-app-update

JavaScript
1
star
20

jquery-rest-observer

A simple jQuery plugin that adds REST observer support for ajax requests
JavaScript
1
star
21

cordova-keyguard-plugin

Cordova keyguard plugin
Java
1
star
22

express-rest-observer

REST observer for Express applications
JavaScript
1
star