kamiazya / typedoc-plugin-mermaid

A plugin for TypeDoc that generates graphs for mermaid.js diagrams by @mermaid annotation.
https://www.npmjs.com/package/typedoc-plugin-mermaid
MIT License
29 stars 9 forks source link

Fetch mermaid graph markdown from README.md #184

Open maneetgoyal opened 4 years ago

maneetgoyal commented 4 years ago

Is your feature request related to a problem? Please describe.

  1. Want to render a Mermaid graph before each class (this plugin already does that).
  2. But the Mermaid graph's markdown is stored in a README.md adjacent to the class.ts[x] file.
  3. Here's an example.
  4. Problem is I am not able to load that graph's markdown so that it can be rendered in TypeDoc.
  5. An entire community of users growing around StencilJS can benefit from this feature.

Describe the solution you'd like

  1. Currently, this plugin allows:
    /**
    * 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 { }
  2. It will be great if a relative/path/to/graph can also be supported as alternate to inline graph.
    /**
    * Hoge is sample class for example of `typedoc-plugin-mermaid`.
    *
    * @mermaid Make TypeDoc easy to use with mermaid.js
    * mermaid-path: relative/path/to/graph
    */
    export class Hoge { }
  3. The plugin loads the markdown file, extracts the mermaid graph and renders it as usual.
kamiazya commented 2 years ago

@maneetgoyal Thanks for reporting!

I fixed it in #630.

kamiazya commented 2 years ago

@all-contributors please add @maneetgoyal for bug.

allcontributors[bot] commented 2 years ago

@kamiazya

I've put up a pull request to add @maneetgoyal! :tada:

kamiazya commented 2 years ago

Sorry, I used the wrong issue to comment on.

I will reopen it.

hatless commented 10 months ago

I'd like to see this include Mermaid code blocks in the rendering of the README.md itself.