Jsdoc Mermaid Save

A tool to automagically create flowcharts and diagrams in your jsdocs.

Project README

jsdoc-mermaid

A plugin that parses your JSDocs for Mermaid syntax and renders the diagrams and flowcharts described.

Getting Started

# install as a local dependency
yarn add -D jsdoc-mermaid # OR npm install -D jsdoc-mermaid

And then add jsdoc-mermaid to your jsdoc configuration file. That's it!

{
    "plugins": ["jsdoc-mermaid"]
}

Usage

Document a method with an @mermaid tag using JSDoc Syntax, like so:

/**
 * Represents a book.
 * @constructor
 * @param {string} title - The title of the book.
 * @param {string} author - The author of the book.
 *
 * @mermaid
 *   graph TD;
 *     A-->B;
 *     A-->C;
 *     B-->D;
 *     C-->D;
 */
function Book(title, author) {
  /* ... */
}

Generate your JSDocs using the configuration you've specified - for instance:

jsdoc book.js -c conf.json 

When you open that page in JSDoc, you should have a shiny new graph!

jsdoc-mermaid example

Built With

  • Mermaid - Generation of diagram and flowchart from text in a similar manner as markdown
  • Doctrine - JSDoc parser

Versioning

We use SemVer for versioning.

Open Source Agenda is not affiliated with "Jsdoc Mermaid" Project. README Source: Jellyvision/jsdoc-mermaid
Stars
50
Open Issues
4
Last Commit
4 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating