Mermaid-Chart/vscode-mermaid-preview

[Feature Request] Open diagram via button

lonix1 opened this issue · 2 comments

It would be nice to have a button to open the preview (instead of doing that manually from the command palette).

Exactly like in this extension. It has an "eye" icon on the top right which opens the preview to the right (like we have when opening .md previews).

Thanks for this great extension!

Thanks for the suggestion!

This makes sense for stand alone .mmd files, but a markdown file can contain multiple diagrams. What should be the behaviour? Preview the diagram where the cursor is, if inside a fence?

Didn't think of that, good point!

I'm unsure. At first thought I'd say it should only be for .mmd files, but that may lead to poor usability (user expects that preview button even when it's not showing).

Showing a preview when the cursor is inside a fence is a good option, but wouldn't that lead to higher CPU usage? Because the extension would need to track the cursor. Then again lots of extensions do that already... Tough call.

Options so far:

  • .mmd files: preview available
  • .md files: preview available only inside fence

The simplest option is to not implement this feature! 😄