MCPcopy Index your code
hub / github.com/Mermaid-Chart/vscode-mermaid-preview

github.com/Mermaid-Chart/vscode-mermaid-preview @v1.6.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.6.3 ↗ · + Follow
23 symbols 48 edges 16 files 0 documented · 0% updated 11mo ago★ 23742 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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



sequenceDiagram A-->B: Works!


Markdown fenced code

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"
}

:warning: 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.

Core symbols most depended-on inside this repo

Shape

Function 17
Method 4
Class 2

Languages

TypeScript100%

Modules by API surface

content-provider.js6 symbols
extension.js4 symbols
lib/find-diagram.js3 symbols
test/utils.test.js2 symbols
previewer/src/components/diagram.js2 symbols
previewer/src/components/app.js2 symbols
previewer/src/components/test.js1 symbols
previewer/src/components/minimap.js1 symbols
previewer/src/components/mermaid.js1 symbols
lib/uses-fontawesome.js1 symbols

For agents

$ claude mcp add vscode-mermaid-preview \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page