jsdoc-mermaid
jsdoc-mermaid copied to clipboard
Mermaid in README.md
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 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.
Mermaid graphs on Readme file are unable to be displayed in the JSDocs... Any solution for this?