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

feat: Added the option to ignore files and folders via settings #289

Merged
merged 24 commits into from
Jan 23, 2024

Conversation

niposch
Copy link
Contributor

@niposch niposch commented Oct 20, 2021

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

@ananthuthilakan
Copy link

kindly update

@ananthuthilakan
Copy link

it looks like author is away since December 2020😥

@makrs11
Copy link

makrs11 commented Feb 10, 2023

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

@mattcoleanderson
Copy link

mattcoleanderson commented Sep 21, 2023

@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?

@MisterPresident
Copy link
Contributor

MisterPresident commented Sep 24, 2023

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

@mattcoleanderson
Copy link

@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.

@ShootingKing-AM
Copy link
Member

Can you rebase this PR and add some Tests ? Do take note of this feature (ShootingKing-AM#154)

@ShootingKing-AM ShootingKing-AM marked this pull request as draft January 7, 2024 07:24
@ShootingKing-AM ShootingKing-AM linked an issue Jan 19, 2024 that may be closed by this pull request
@ShootingKing-AM
Copy link
Member

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 :)

@niposch
Copy link
Contributor Author

niposch commented Jan 23, 2024

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.

@ShootingKing-AM ShootingKing-AM mentioned this pull request Jan 23, 2024
@ShootingKing-AM ShootingKing-AM marked this pull request as ready for review January 23, 2024 14:21
@ShootingKing-AM
Copy link
Member

niposch and others added 2 commits January 23, 2024 16:34
commit 867f230
Author: niposch <niposch@gmail.com>
Date:   Tue Jan 23 16:34:09 2024 +0100

    fixed python tests
@ShootingKing-AM
Copy link
Member

still you can find the failed tests here #503

@ShootingKing-AM ShootingKing-AM changed the title Added the option to ignore files similar to a .gitignore file via settings feat: Added the option to ignore files and folders via settings Jan 23, 2024
@ShootingKing-AM ShootingKing-AM merged commit af2424d into ObsidianToAnki:master Jan 23, 2024
15 checks passed
@ShootingKing-AM
Copy link
Member

ShootingKing-AM commented Jan 23, 2024

Thanks for the awesome feature ! @niposch
Tests for this PR are done in #504

@ShootingKing-AM ShootingKing-AM added enhancement New feature or request fix Fixed some bug/issue labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix Fixed some bug/issue
Projects
None yet
6 participants