jsdoc-mermaid icon indicating copy to clipboard operation
jsdoc-mermaid copied to clipboard

Mermaid in README.md

Open kevinkleine opened this issue 4 years ago • 2 comments

Cool plugin! I'm using it extensively. Would be nice if it would also render mermaid charts from the README.md on the "Home" page of the documentation.

kevinkleine avatar Dec 19 '20 09:12 kevinkleine

@kevinkleine I looked into this as I also wanted to include mermaid charts in the README and tutorials. Unfortunately it is not possible to implement in a jsdoc-plugin. It has no API to hook onto the README file or tutorials (jsdoc only passes doclets and whole js files to transform).

I got it to work anyways. I am using the fact, that the jsdoc markdown parser (marked) by default allows HTML to be added (even JavaScript). I created an script which detects GitLab-style mermaids and creates the graph with mermaid.

Use mermaid in jsdoc tutorials

It is quite hacky so I hope that jsdoc-plugins get more capabilities in the future (little hope though due to inactivity in the jsdoc repository). Also my solution requires to add the script to each markdown including mermaid charts which is very annoying.

sahithyen avatar Jan 29 '21 15:01 sahithyen

Mermaid graphs on Readme file are unable to be displayed in the JSDocs... Any solution for this?

FilipaChambel avatar Dec 13 '23 12:12 FilipaChambel