Package detail

typedoc-plugin-mermaid

kamiazya55.5kMIT1.12.0

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

typedoc, typedocplugin, mermaid, graph

readme

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 ↓↓](https://kamiazya.github.io/typedoc-plugin-samples/classes/hoge.html)

[![Example](https://github.com/kamiazya/typedoc-plugin-mermaid/raw/main/media/example.png)](https://kamiazya.github.io/typedoc-plugin-samples/classes/hoge.html)

### Arguments

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

```bash
$ 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

changelog

typedoc-plugin-mermaid

1.12.0

Minor Changes

Patch Changes

1.11.1

Patch Changes

1.11.0

Minor Changes

Patch Changes

  • #857 9a5db15 Thanks @kamiazya! - Add Dependabot setting for GitHub Actions

  • #857 9a5db15 Thanks @kamiazya! - Migrate formater and linter to biome from eslint and prettier

  • #857 9a5db15 Thanks @kamiazya! - Add "provenance" flag to publishConfig in package.json

  • #857 9a5db15 Thanks @kamiazya! - Add typecheck script for TypeScript type checking

  • #857 9a5db15 Thanks @kamiazya! - Introduce Changeset.

  • #857 9a5db15 Thanks @kamiazya! - Bump vite from 5.2.13 to 5.3.0

  • #857 9a5db15 Thanks @kamiazya! - Migrate package manager to pnpm from yarn

    • Setup pnpm workspace and ignore "example" in Changeset configuration
  • #857 9a5db15 Thanks @kamiazya! - Bump @types/html-escaper from 3.0.0 to 3.0.2

  • #857 9a5db15 Thanks @kamiazya! - Update package.json exports

  • #857 9a5db15 Thanks @kamiazya! - Update README for TypeDoc 0.24 and 0.25

  • #857 9a5db15 Thanks @kamiazya! - Migrate build and test tool to vite/vitest from rollup/jest

  • #857 9a5db15 Thanks @kamiazya! - Add GitHub workflow to update copyright year in license file

  • #857 9a5db15 Thanks @kamiazya! - Add Snapshot release workflows

    • New Features
      • Introduced snapshot release automation for pull requests using GitHub Actions.
      • Added new GitHub Action to perform snapshot releases based on specific comments.
      • Implemented a prerelease job in CI/CD workflow for automated next version releases.
    • Improvements
      • Added new configuration options for snapshots to support pre-release templates and calculated versions.
      • Improved GitHub Actions setup with an option to skip the checkout step for better performance.
    • Automation
      • Enhanced workflow automation including permission checks, artifact handling, and snapshot release validation.
  • #857 9a5db15 Thanks @kamiazya! - Bump actions/checkout from 4.1.6 to 4.1.7

  • #857 9a5db15 Thanks @kamiazya! - Update dependencies and configuration files