Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.excalidraw.md files are not deleted + feature ideas #61

Closed
Iphinis opened this issue Aug 19, 2024 · 6 comments · Fixed by #66
Closed

.excalidraw.md files are not deleted + feature ideas #61

Iphinis opened this issue Aug 19, 2024 · 6 comments · Fixed by #66
Labels
enhancement New feature or request

Comments

@Iphinis
Copy link

Iphinis commented Aug 19, 2024

Hello,

Is it normal that .excalidraw.md files aren't deleted with .* and even with .excalidraw.md or .excalidraw.* ?

I also tried *.excalidraw.* and *.excalidraw.md but those seems to be incorrect expressions (they are deleted instantly when I close the settings panel). Maybe it is because it ends with ".md" ? (that expression doesn't work either, thankfully ahah, for security reasons I suppose)

Also I have an idea, when the deleting prompt appears it would be nice if we could check for each file (or even folder) whether we delete it.

Another little thing is that it would be nice in the setting panel if the textbox had a min-width (according to its content, or not, as you wish).

Thanks in advance.

@husjon husjon added the bug Something isn't working label Aug 19, 2024
@husjon
Copy link
Owner

husjon commented Aug 19, 2024

Hmm this might be because of the .md suffix which might make it so that the plugin assumes that is is a normal markdown file and does not do further processing (other than the file being completely empty).
I'll need to look into this further.

As for the file extensions you tried, I think you should have tried the following: .excalidraw.* and .excalidraw.md, as in omitting the initial *.

Regarding the check for each file (and/or folder) to be deleted, do you mean just inspection or to select if they should be deleted or not as in a checkbox, if so this is in the works (however taking some time) with the following issue #58

As for textbox min-width in settings, this I agree with wholly, I created an issue for it and I'll take a loook at it in the near future (#62).

@Iphinis
Copy link
Author

Iphinis commented Aug 19, 2024

Yup, I think I have already tried it when I opened the issue but I didn't want to bother writing all my tests.
To be sure I just did it right now and it doesn't work.

Yes something like a checkbox for each element! Because when I clear my files there could be a situation where I don't want to remove a certain file at the moment.
Furthermore, you could also create an option to ignore certain files (as you did for folders), and in addition creating a button next to the checkbox and the file/folder name to add it to the ignored list (when the user wants to clear the vault).

Thank you very much for considering my suggestions! Implement them if you wish and perhaps gradually ;)

@husjon
Copy link
Owner

husjon commented Aug 29, 2024

So, I've had a look at why the excalidraw files are not deleted.
They do use their own format, however it does follow markdown standard so it is possible to parse and determine if they are empty or not.

My main issue is that Excalidraw by default compresses the files to make the drawings take less space (not a bad thing at all it just complicates things), this seem to use an external library which I kinda do not want to include in this plugin for this one specific case.
What I am however thinking off is to make it possible so that if the Excalidraw files are not compressed (which can be toggled in Excalidraws settings), I can clean them up by inspecting the content and verify that they are empty.

This will unfortunately take a bit of time to get it working.
However with the rewrite I did back in June will make it a bit easier as I did make it possible to further inspection code blocks etc (which Excalidraw uses to contain the drawing data).

As for the size of the text boxes, I have prepared a fix and will be releasing it shortly (#63), they will now be resizable within a certain range and wont freak out like before. :)

@husjon husjon linked a pull request Sep 3, 2024 that will close this issue
@husjon husjon added enhancement New feature or request and removed bug Something isn't working labels Sep 3, 2024
@husjon
Copy link
Owner

husjon commented Sep 3, 2024

Hi @Iphinis, I have now prepared a pull request to add support for Excalidraw files (see #66).
As mentioned in my previous comment, this will require the user to disable compression in Excalidraw.

I will merge the PR some time tomorrow, it will be a part of v1.1.0.

@husjon husjon closed this as completed in #66 Sep 4, 2024
@Iphinis
Copy link
Author

Iphinis commented Sep 5, 2024

Hi @husjon!
First of all, thank you so much for your work!! I just tried the new features and actually what I meant by deleting excalidraws was delete those that weren't referenced (or embeded as they say) in a .md document.

I think you misunderstood my request but it's also a cool feature to clean empty drawings :)

Would it be possible to implement the suppression of unreferenced excalidraw files, like it's done for other formats such as .png etc ? What I mean is that I want to keep drawings that are referenced such as ![[Drawing.excalidraw]] in Wikilinks format but delete those that aren't embeded/referenced/linked in a markdown file.

Thank you in advance!

@husjon
Copy link
Owner

husjon commented Sep 5, 2024

Ah, so if I understand it correctly excalidraw files should have been handled like attachments instead of how they are now, is that correct?

If so, please also leave a comment in the the following issue above so I can track it there (#68), thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants