zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.25k stars 233 forks source link

FR: Hide "Excalidraw Data" Markdown section in specified Callout Box #1836

Open Tetrakron opened 5 months ago

Tetrakron commented 5 months ago

Context

My Issue is referencing the problem that came up in one of Zsolt's videos: Start using the flipside of your markdown notes.

In the video he describes the usecase that a user can "flip" between Markdown notes and Excalidraw notes in the same file and use both. This is achieved by writing a normal markdown note and then adding the excalidraw-plugin: parsed property.

By adding what I'll be refering to as the "Excalidraw-Data" section (basically JSON) you can can convert the file with the command "Toggle between Excalidraw and Markdown mode" between Markdown and Excalidraw.

The Problem

The issue arises in Live Preview Mode when one wants to write in Markdown and draw in Excalidraw while also having a clutter-free markdown experience: Yes you have the ability to add comments (%%) before and after the "Excalidraw-Data" section to hide it in Reading Mode but this doesn't hide the section in Live Preview Mode at all.

In Live Preview Mode the section expands more and more when you add new items to the visual Excalidraw note. This is annoying because lets say I have text stored at the bottom of a markdown file that I need to edit. It would take a lot of time for me to scroll all the way down just to edit some text. You also aren't able to see what text is below the "Excalidraw-Data" section and would have to switch to Reading Mode first.

Possible Solution

Add the option to use an obsidian callout box specifically for use with the Excalidraw-Plugin. The callout can be named with a title like "excalidraw-plugin" or "excalidraw-parse". The contents of the callout should embed the whole "Excalidraw-Data" section and should only be parsed by the plugin.

This would give the user the ability to "stash away" the content of the Excalidraw section in the callout and would keep the note clutter-free in Live Preview Mode (see picture).

Example Callout

>[!excalidraw-parse]- > # Excalidraw Data > ## Text Elements > ## Drawing > ```json >.... >```

The Visual difference

flip-notes

TolgaKerem07 commented 2 months ago

I agree, the "Excalidraw Data" header is currently the main thing that prevents me from using the flipside feature

jpstone commented 1 month ago

Please please please consider adding this feature :)

alloc33 commented 1 month ago

I'm more curious about how to hide this stuff?

image