Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mermaid in README.md #7

Open
kevinkleine opened this issue Dec 19, 2020 · 2 comments
Open

Mermaid in README.md #7

kevinkleine opened this issue Dec 19, 2020 · 2 comments

Comments

@kevinkleine
Copy link

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.

@sahithyen
Copy link

@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.

@FilipaChambel
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants