vsch / idea-multimarkdown

Markdown language support for IntelliJ IDEA.
https://plugins.jetbrains.com/plugin/7896-markdown-navigator
Apache License 2.0
813 stars 129 forks source link

Preview of mermaid diagrams in separate files #832

Open sindre-nistad opened 4 years ago

sindre-nistad commented 4 years ago

Hi, Would it be possible to have Markdown Navigator render / preview mermaid files (.mmd)?

Some background

Since GitHub does not support mermaid rendering (yet), I have to create separate SVG / PNGs from separate files. In order to preview them, I could change the file extension to .md, and then surround the content with

```mermaid
<content remind unchanged>

The files are then passed though [markdown.cli](https://github.com/mermaidjs/mermaid.cli) (which crashes when it sees ` ``` `)

This is a bit inconvenient, and so it would be nice to have Markdown Navigator to these steps (or similar) behind the scenes.

---
Or better yet, have GitHub implement the rendering
vsch commented 4 years ago

@sindre-nistad, the extension to language mapping is controlled by the IDE. The plugin provides defaults: .md, .mkd and .markdown.

If you add .mmd extension association with Markdown language in Editor | File Types

image

If you know if any website which renders mermaid syntax to image similar to gravizo.com for UML and codecogs.com for Latex then I can add an option to use that site for rendering mermaid instead of the JavaScript in the rendering page.

This would allow creating mermaid HTML images using that site and conversion between HTML tags and fenced code syntax as done for Math and UML elements. It makes it a little easier to maintain since the conversion can be done by the plugin in the markdown source.

antonbabenko commented 4 years ago

http://kroki.io/ can do rentering as image and much more.

vsch commented 4 years ago

@antonbabenko, thank you for the rendering site link. I will add it as an option.

antonbabenko commented 4 years ago

Great plugin! 👍

I am looking forward to getting the full support of Mermaid in this plugin so that I don't have to use mermaid-live-editor all the time.

vsch commented 4 years ago

Kroki support is working, now all fenced code special rendering is configured in Fenced Code

Also added JLatexMath rendering to images to allow embedding images in PDFs by using it as the rendering option.

I just have to update documentation and fix a late found bug and I will release an EAP version for 2020.1, and maybe for 2019.x IDEs also. The latter is a ton of work since the source branches have diverged and require manual code merging for the project. I would like not to have to do it more than once per release cycle.

vsch commented 4 years ago

EAP update with a fix for the issue is available.

Installing EAP Plugin Version

Please note the change that EAP channel is for JetBrains licensed plugin and Legacy EAP is for legacy licensing by vladsch.com