ObsidianToAnki / Obsidian_to_Anki

Script to add flashcards from text/markdown files to Anki
GNU General Public License v3.0
1.43k stars 128 forks source link

scanning the current note(only) #246

Open PSEUDO-SAPPHO opened 3 years ago

PSEUDO-SAPPHO commented 3 years ago

can we have an option to search and scan just current note? I have thousands notes and long hour scans keep bothering me.

and of course with pre-full heart thank for this plugin.

pikawindy commented 2 years ago

I totally agree with that, but my problem is I already had a template for anki when i click the "Scan" button that my template also changed to a fashcard. a b

cocofoco commented 2 years ago

I concur. I also have ~8000 notes in my vault and the vault-wide scans kill my CPU and crash Obsidian.

Having the option to scan only the current note would be amazing.

Thank you in advance.

cocofoco commented 2 years ago

Current workaround

As of 27-sep-2021, there is no option for the obsidian-to-anki plugin to scan only the current page instead of the whole vault.

This is my current workaround:

  1. I created an Anki folder, which lives inside my main vault, and another folder Temporary Anki vault, which is external to main vault. This folders are two-way synced locally.

When I want to create cards from an Obsidian note, I:

  1. create a copy of such note titled {{Title}} -- Anki

  2. Move {{Title}} -- Anki to Anki folder (in main vault).\ If you don't like creating copies, skip step 1 and just move the file directly into the Anki folder.

  3. do all my editing and card-creation inside my main vault

  4. once I'm done editing, I just switch vaults and go to Temporary Anki vault. Here, we should find a copy of {{title}} -- Anki (synced from the Anki folder).

  5. With Temporary Anki vault open in Obsidian, press the scan vault button.

  6. After sending the cards to Anki, the note-ID is added at the bottom of each card. So the files, which contain all the cards and live in the Temporary Anki vault, will be modified. But this should not lead to any data loss: since the folders are also 2-way synced, once the files are modified, all the changes will also appear in the files in the Anki folder inside the main vault.

!!!!! TRY TO HAVE ONLY ONE OF THESE 2 VAULTS OPEN AT ANY TIME. HAVING BOTH OF THEM OPEN ON THE SAME PAGE MAY CAUSE PROBLEMS !!!!!

How do I sync the 2 folders?

To sync the folders, I use FreeFileSync. It's lightweight and easy to setup. The whole installation + time to learn how use the software + setup took less than 20 mins.

solution to the problem & forwards compatibility

Once this feature is added Scan the specified folder in the vault instead of the entire vault · Issue #274 · Pseudonium/Obsidian_to_Anki · GitHub, this workaround will be useless.

The good thing is that, in theory, when the developers add this feature, even if you are using this workaround, you shouldn't get any issues from updating the plugin.\ This is obviously not a certainty, but I just can't see how an update could break anything: when the update comes, one can simply delete the extarnal folder and keep on using the updated plugin, scanning the internal Anki folder instead of the external vault.

dd1512 commented 2 years ago

Thanks @cocofoco for the workaround. I've had exactly the same issue. And this does wonder. This is definitely a powerful plugin and this feature Scan the specified folder in the vault instead of the entire vault · Issue #274 · Pseudonium/Obsidian_to_Anki · GitHub hopefully will be soon released as it's soo critical.