typedoc-plugin-mermaid

v1.11.0
A plugin for TypeDoc that generates graphs for mermaid.js diagrams by using @mermaid annotation.
typedoc typedocplugin mermaid graph diagram

GitHub Action CodeFactor npm version node version npm FOSSA Status License: MIT PRs Welcome All Contributors format: Biome test: Vitest build: Vite

typedoc-plugin-mermaid

A plugin for TypeDoc that generates graphs for mermaid.js diagrams by @mermaid annotation.

Installation

The plugin can then be installed using npm:

NPM

# npm
npm install --save-dev typedoc-plugin-mermaid
# or yarn
yarn add -D typedoc-plugin-mermaid

Add this plugin in your typedoc.json:

{
  "plugin": ["typedoc-plugin-mermaid"]
}

If you use the @mermaid tag in your tsdoc comments, add typedoc-plugin-mermaid/tsdoc.json to the extends of tsdoc.json:

{
  "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
  "extends": [
    "typedoc-plugin-mermaid/tsdoc.json"
  ]
}

Usage

Write tsdoc with @mermaid annotations:

/**
 * Hoge is sample class for example of `typedoc-plugin-mermaid`.
 *
 * @mermaid Make TypeDoc easy to use with mermaid.js
 * graph TB
 *   mermaid.js --> TypeDoc;
 */
export class Hoge { }

Or use fenced code blocks:

/**
 * Mermaid code blocks are automatically detect and converted.
 *
 * ```mermaid
 * graph TB
 *   mermaid.js --> TypeDoc;
 * ```
 */
export class Mermaid { }

โ†“โ†“ DEMO โ†“โ†“

Example

Arguments

The following arguments can be used in addition to the default TypeDoc arguments.

$ typedoc --help
...
Options:
 --mermaidVersion            [Mermaid Plugin] The version of mermaid.js to use.
...
  • --mermaidVersion

    Specify mermaid.js version to use.

    Default: latest, Example: 8.14.0

Contributors

Thanks goes to these wonderful people (emoji key):

Yuki Yamazaki
Yuki Yamazaki

๐Ÿค” ๐Ÿ’ป โš ๏ธ ๐Ÿ“–
Bob Kerns
Bob Kerns

๐Ÿ› ๐Ÿ’ป
Emily Marigold Klassen
Emily Marigold Klassen

๐Ÿ’ป โš ๏ธ
Mathieu Jalbert-Claveau
Mathieu Jalbert-Claveau

๐Ÿ›
Michael Schmidt
Michael Schmidt

๐Ÿ’ป โš ๏ธ ๐Ÿ“–
Carl Fรผrstenberg
Carl Fรผrstenberg

๐Ÿ› ๐Ÿš‡
Will Henderson
Will Henderson

๐Ÿ’ป ๐Ÿ› ๐Ÿ’ก
guryanovev
guryanovev

๐Ÿ›
Ricardo Ferreira
Ricardo Ferreira

๐Ÿค”
Maneet Goyal
Maneet Goyal

๐Ÿค”
Juergen Zimmermann
Juergen Zimmermann

๐Ÿ›
Michal Kindl
Michal Kindl

๏ธ๏ธ๏ธ๏ธโ™ฟ๏ธ
Ludovic Muller
Ludovic Muller

๏ธ๏ธ๏ธ๏ธโ™ฟ๏ธ

This project follows the all-contributors specification. Contributions of any kind welcome!

License

This software is released under the MIT License, see LICENSE.

FOSSA Status

Metadata

  • MIT
  • >=16.0.0
  • kamiazya
  • released 6/13/2024

Downloads

Maintainers