jannis-baum / Vivify

Bring your Markdown to life
GNU General Public License v3.0
22 stars 3 forks source link

Mermaid Support #132

Closed sollymay closed 2 weeks ago

sollymay commented 1 month ago

Would be awesome to see mermaid graphs displayed on the preview.

jannis-baum commented 1 month ago

Noted! I have some other things on the todo-list before I would add this, but if you want it sooner rather than later I'd be happy about a PR! :)

In case you are interested in contributing (or if not for my own future reference):

A quick search for a Mermaid Markdown-It plugin didn't seem like there was a well-maintained and popular one so I would suggest implementing this analogously to how we handle dot/graphviz in src/parser/dot.ts by integrating the official parser (https://www.npmjs.com/package/mermaid)

tuurep commented 1 month ago

integrating the official parser

I was looking at how iamcco/markdown-preview.nvim does this, and seems like it's just that as well:

https://github.com/iamcco/markdown-preview.nvim/blob/master/app/pages/mermaid.js

Tweekism commented 1 month ago

Yeah seems iamcco was just grabbing the the mermaid.min.js from the mermaid package on npm and adding it into his app/_static directory.

In the mermaid package its .../dist/mermaid.min.js

https://www.npmjs.com/package/mermaid/

pidgeon777 commented 1 month ago

Mermaid.js support would be great!

jannis-baum commented 1 month ago

I have 2 other things pending for Vivify, after those are done I'll do this one :)

sollymay commented 2 weeks ago

Awesome! Thank you for implementing this so quickly! I'll test once I get a chance

jannis-baum commented 2 weeks ago

Awesome! Thank you for implementing this so quickly! I'll test once I get a chance

Great! Let me know in case there's something different from how you expected it :)