mjbvz / vscode-markdown-mermaid

Adds Mermaid diagram and flowchart support to VS Code's builtin markdown preview
https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid
MIT License
648 stars 119 forks source link

Option to render diagram to SVG on save instead of inserting js bundle? #75

Closed dylan-robins closed 4 years ago

dylan-robins commented 4 years ago

I'm using this extension to insert diagrams into HTML reports using a "print to HTML" extension, and in my use case the in-browser rendering is causing me quite the headache. How feasible would it be to add an option to be able to render the diagram in VSCode in such a way as that the "printed" html contains the SVG diagram instead of the mermaid code with the bundle of js? I had a quick look through the code but am not familiar with Typescript or the structure of VSCode extensions - is it a question of replacing the preProcess() function in the index.js with something replicating the functionality of the provided js bundle?

mjbvz commented 4 years ago

Last time I checked, mermaid can only be run in browser environments (their cli also just launches a browser). This makes it difficult to generate the diagrams in the extension instead of in the webview

mjbvz commented 4 years ago

Closing this due to lack of followup