Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @liradb2000/markdown-it-mermaid with all npm packages installed. Try it out:

var markdownItMermaid = require("@liradb2000/markdown-it-mermaid")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@liradb2000/markdown-it-mermaid v0.3.7

Forked Package markdown-it-mermaid (Newely).

Update Mermaid 8.4!

  • New diagrams (classDiagram)
  • Support gitGraph
  • Support securityLevel options

more details : http://knsv.github.io/mermaid/#/README?id=new-diagrams-in-84

markdown-it-mermaid

Mermaid plugin for markdown-it.(Forked)

Installation

yarn install @liradb2000/markdown-it-mermaid

Usage

import markdownIt from "markdown-it";
import markdownItMermaid from "@liradb2000/markdown-it-mermaid";
const mdi = markdownIt();
mdi.use(markdownItMermaid);
mdi.render(`\`\`\`graph TD
    A[Christmas] -->|Get money| B(Go shopping)
    B --> C{Let me think}
    C -->|One| D[Laptop]
    C -->|Two| E[iPhone]
    C -->|Three| F[Car]
\`\`\``);

Customize mermaid

import MarkdownIt from 'markdown-it';
import MarkdownItKatex from '@liradb2000/markdown-it-mermaid';

var md = MarkdownIt({
        html: false,
        linkify: true,
        typographer: true,
        breaks: true,
        xhtmlOut: false,
    });

md.use(MarkdownItMermaid,{
  startOnLoad: false,
  securityLevel: true,
  theme: "default",
  flowchart:{
    htmlLabels: false,
    useMaxWidth: true,
  }
  ...or any options
})

Development

Build

yarn build:watch

Test

yarn test

Distribution

yarn release && npm publish
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free