โ† All requests
0

Toggle between code and diagram for Mermaid blocks (and a raw Markdown view)

OpenTasks & subtasksAndor Markus ยท

Hi Kaneo team ๐Ÿ‘‹

First of all, thank you for adding Mermaid rendering (#1452 / #1453)! Keeping diagrams as text inside the task works really nicely.

The idea
Right now a Mermaid block always shows its source with the rendered diagram underneath. For bigger diagrams the code takes up a lot of room, and most people reading the task only need the picture.

It would be lovely to switch a Mermaid block between:

  • Diagram: only the rendered diagram, great for reading
  • Code: only the source
  • Both: today's view, handy while editing

The same for Markdown
A way to flip the task description between the rich editor and its raw Markdown would help too. It would make it easy to copy the exact Markdown, fix formatting that's fiddly in the editor, or paste in a big chunk at once.

How other tools handle it

  • Notion: Mermaid code blocks have a Code / Preview / Split menu next to the language picker.
  • Outline (also built on ProseMirror): you can switch a Mermaid block between source and diagram view.
  • GitHub: Write / Preview tabs on issues and comments, and Preview / Code when viewing a .md file.
  • Obsidian: Source mode or Live Preview for the whole note. In Live Preview, clicking a diagram opens its source.

A possible approach (just a suggestion!)

  • Add a small Code / Diagram / Both switch next to the existing language dropdown when the language is Mermaid. If the choice isn't saved into the Markdown, the stored content stays a plain mermaid code block.
  • Show only the diagram when you're not editing, and reveal the source on click or with an Edit button.
  • For descriptions, a "View Markdown" toggle in the toolbar could show the editor's Markdown in a plain text box and turn it back into rich text when you switch back.

It's a small addition to controls that already exist, with no new data model. Happy with whatever fits Kaneo's focus on simplicity best. Thanks again for all the great work! ๐Ÿ™

Discussion 0

No comments yet.

Sign in to comment.

Keyboard shortcuts

Anywhere

Go to requests
gh
Go to changelog
gc
Go to notifications
gn
Next or previous page
norp
Leave a text field or close a menu
Esc
Show this list
?

Requests

Move to the next or previous request
jork
Open the selected request
oorEnter
Vote on the selected request
v
Search
/
New request
c

Request

Vote
v
Write a comment
c
Edit
e