Obsidian_to_Anki icon indicating copy to clipboard operation
Obsidian_to_Anki copied to clipboard

Added the option to ignore files similar to a .gitignore file via settings

Open niposch opened this issue 3 years ago • 2 comments

I added a text field in the settings where globs can be put into. If any of these match a file, it will be ignored and therefore not be scanned.

This feature is especially useful when using this plugin in combination with the obsidian-excalidraw-plugin because this plugin stores its files as .excalidraw.md. This will cause the Obsidian_to_Anki plugin to scan these files. Excessive scan times are caused by scanning these large files. Adding **/*.excalidraw.md to the ignore option will alleviate this problem because these files will be ignored. It could also be useful if a user wishes a specific folder not to be scanned (f.e. the template folder) The option I added should behave like a git ignore file which is documented here: https://git-scm.com/docs/gitignore

niposch avatar Oct 20 '21 13:10 niposch

kindly update

ananthuthilakan avatar Nov 04 '21 08:11 ananthuthilakan

it looks like author is away since December 2020😥

ananthuthilakan avatar Nov 04 '21 10:11 ananthuthilakan

If somebody else is looking for a solution to use Obsidian to Anki with Ecalidraw: Just activate the compression function in the Excalidraw options. In my case this changes the filetype from .excalidraw.md to .excalidraw and stops Anki from searching these files and freezing in the process. grafik

makrs11 avatar Feb 10 '23 11:02 makrs11

@Pseudonium Is there any chance we could get this feature merged? There are conflicts that I'd be willing to look into resolving, but since this PR is so old I'd like to get some confirmation on whether it has a chance of being merged back?

This feature to ignore files is very beneficial for:

  • speeding up scan times
  • utilizing plugins such as Templater without creating unnecessary anki cards

If not, could you drop a comment as to why and close the PR as won't merge?

mattcoleanderson avatar Sep 21 '23 21:09 mattcoleanderson

Maybe we should think about a maintained fork. Whenever @Pseudonium comes back we could merge it back. #447

MisterPresident avatar Sep 24 '23 08:09 MisterPresident

@MisterPresident I was thinking about that myself. One of the worst things about such impactful open-source projects like this, is they tend to succumb to Bus Factor one day. Many good obsidian plugins especially have. It's really important for project owners to find a few contributors to give write access to so the project can continue without you. But at least there is a LICENSE file. So separately maintained forks can be used for distribution.

mattcoleanderson avatar Oct 07 '23 04:10 mattcoleanderson

Can you rebase this PR and add some Tests ? Do take note of this feature (https://github.com/ShootingKing-AM/Obsidian_to_Anki/pull/154)

ShootingKing-AM avatar Jan 05 '24 19:01 ShootingKing-AM

Are you done @niposch ? Can you add some information about this feature and how to use in Readme.MD. Also since we already know that excalidraw, Templater obsidian addons can you set the default setting to ignore this file.

It would be also awesome if you can do a hyperlink some example so that a common (non-developer) can understand how to use globs (dont specify .gitignore :) ). Also you can have some examples as placeholder text, like "ignore_this_file.md\nignore_this_dir/*" so that it will be easy for common users to understand.

Let me know when you are done, want to merge this feature as soon as possible :)

ShootingKing-AM avatar Jan 23 '24 12:01 ShootingKing-AM

I'm done. Added a bit more documentation and a default value for the setting and a better placeholder. I haven't figured out what to do about ignoring the template folder as there isn't any default template folder name I'm aware of. Maybe we could add *[Tt]emplate*/** but that could also be error prone.

niposch avatar Jan 23 '24 14:01 niposch

Seems like some tests are failing - https://github.com/Pseudonium/Obsidian_to_Anki/actions/runs/7627084329/job/20774950101?pr=503#step:7:9685

ShootingKing-AM avatar Jan 23 '24 14:01 ShootingKing-AM

still you can find the failed tests here #503

ShootingKing-AM avatar Jan 23 '24 16:01 ShootingKing-AM

Thanks for the awesome feature ! @niposch Tests for this PR are done in https://github.com/Pseudonium/Obsidian_to_Anki/pull/504

ShootingKing-AM avatar Jan 23 '24 21:01 ShootingKing-AM