This post will continue as an introduction. The code is retained and can be found in the fork jdysya/obsidian-markmap-fileviews
Original Post: Obsidian Chinese Forum t37790
A case of custom view, suitable for plugin learning.
- Create a markdown mindmap view of the active note via command
- Default hotkey
Ctrl + M
. - Internal links are rendered as buttons, which open a corresponding editable popover when clicked. Sometimes the first click may focus instead of triggering the action, just click again.
- Press and hold the Ctrl key to drag and move the position of the popover.
- Default hotkey
- Codeblocks
```markmap --- markmap: height: 200 --- ## Root ### Branch1 ### Branch2 ```
- Frontmatter is optional. Only support height (px) since no more packages are wanted to be introduced.
- Export PNG / PDF
ref.js in the .old
folder contains written but unused code, relevant code, and a list of reference plugins.
Gallery (2024-07-28)
- Test text is modified from Markmap official example: Try markmap
Deficiencies
-
If Obsidian is in reading mode when you open a new note containing markmap codeblocks, you need to manually refresh them once after switching back to editing mode. issue#4
Workaround is using the ‘rebuildCurrent’ command of the plugin in Mini Plugin Sheets Basic: Merge Markdown Table Cells to quickly refresh. You can refer to the code and register by yourself too.
-
Codeblocks in Markmap don’t get highlighted when exported, possibly because the SVG is directly converted, and CSS styles are not included in it.
Update: Well, it seems that the export demonstration given in the official example does not have highlighting either.