-
Notifications
You must be signed in to change notification settings - Fork 1
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
Plugin overwrites decks after manual edits in Anki #6
Comments
Hi, thanks for reporting this and I can see why the mapping of synced folders in Obsidian to Anki decks might be confusing. However, for now this is all working as designed and documented. First point — and this one might be worth changing: Decks are created, as needed, if there is a note to contain in a given hierarchy. Currently, syncing
Will yield the following deck in Anki, because
If you add a second folder to
Yields the following decks in Anki:
If you then add a note to the root of Flashcards, you'll get the full hierarchy:
Yields:
The idea here is that you can sync a folder of folders in Obsidian, without necessarily including top-level folder as a deck. In my case I have an (And there's additional logic on top of that do deal with multiple nested "empty" folders, etc...) But I can see how automatically pruning the hierarchy can be unexpected. I'll weigh changing this behavior and post to this issue thread when a change (or a decision to leave as-is) is made. Second point, and this is not subject to change: Your markdown notes and their hierarchy are the single point of truth. This is why editing Yanki-generated cards or decks in Anki is not recommended or supported. You described doing exactly this in your summary when you moved the subdeck in Anki in your step 5. When you synced again, Anki saw that some of the notes it had previously created were now in the "wrong" deck according to the logic outline above, and moved them accordingly to match the hierarchy of your synced folder. Even if you disagree with how it maps folder hierarchy to deck hierarchy, there's no reason for a deterministic system's actions to change across invocations on that basis alone. 😁 Also regarding a potential "huge disaster", it's worth noting that any cards Anki had not previously created / synced were never at risk, since Yanki only ever acts on Anki notes that it has previously created with a specific note type, namespace field, and namespace value. |
I'm editing the issue title to make it clear that this behavior is not happening spontaneously, since it's happening after manual changes are made to Yanki-generated cards in Anki, as advised against in the documentation. |
I've added some documentation to the readme explaining the logic around how folders and notes are mapped to deck. There also was one data losing bug that has been identified and fixed in issue #14 , which is possibly related to what you originally reported. If you run into anything similar in the future and would like support, please open a new issue with a minimal sample vault and steps to reproduce. |
Luckily, I used an empty deck for testing. The disaster could have been huge.
Despite the plugin instructions stating that the complex deck structure of the monitored folder works, it doesn't. All subdecks are created in the vault without any hierarchy.
The procedure was as follows:
In summary, we have two problems:
The text was updated successfully, but these errors were encountered: