How To Sync Obsidian With Anki Automatically / Plugin Walkthrough
In this video I break down the process of syncing and creating anki cards from Obsidian, with a great Obsidian Community plugin.
Check out the Obsidian_to_Anki GitHub page, it has excellent instructions on how to set things up.
Follow the steps to add AnkiConnect
These steps are clearly explained in the video tutorial above.
In order to keep things in this format
this is the front of the card #flashcardthis is the back
we need to add this line of regular expression into the plug in settings.
((?:[^\n][\n]?)+) #flashcard ?\n*((?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))+)
Where to put this line?
Open Obsidian settings
Scroll down to the "Plugin Options" section
Find "Obsidian_to_Plugin" settings
In the Note type settings, open the dropdown that says "Note type table"
Go to the first line that says basic
Paste this line
((?:[^\n][\n]?)+) #flashcard ?\n*((?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))+)
Refresh obsidian
Done
you can find more info about this format here
Remember to determine the deck name at the beginning of your file
TARGET DECK: Esperanto
Now you should be able to create new cards like this:
this is the front of the card #flashcardthis is the back
open the command palette search "Obsidian_to_Anki: Scan Vault"
Keep Anki open the whole time while doing this otherwise it won't work.
once everything is good your note should have an automatic ID created like this:
<!--ID: 1234567890123-->
Your final note should look like this
TARGET DECK: Esperantothis is the front of the card #flashcardthis is the back<!--ID: 1234567890123-->
Deleting cards
IF you want to delete a card, you must write
DELETE
above the ID
like this
this is the front of the card #flashcardthis is the back
open the command palette write "Obsidian_to_Anki: Scan Vault"
It should look like this:
this is the front of the card #flashcardthis is the back
now you can safely delete the card's text.
This plugin is still in it's early stages, if you are feeling adventurous you can try the python script found in the same Obsidian_to_Anki GitHub page.
The python script requires more setup, I used it in Linux and it worked great.
But I do hope to see this Obsidian Community Plugin grow and become even easier to use.
Key sections of the wiki page
The documentation on this plugin is great, here are some of the most useful parts I found:
Learn More
Become an Obsidian power user with my course, my goal is to teach everything I know about Obsidian there.
check out my Obsidian Course