Thanks for building this so that I didn’t have to, hah!
I wonder if there’s a way to achieve some kind of syncing. E.g., if you update a note in Obsidian, is there a way to make sure the associated Anki card(s) get updated rather than creating new ones…? Hm.
So at the moment it works on a per-file basis. You’d have to go through the files individually.
I’ve set a flag to disallow duplicates (from AnkiConnect), but I haven’t tested it.
So there is a part of the AnkiConnect API that allows you to update an existing note rather than create a new note. I haven’t looked into it that much though.
Yeah hopefully that won’t be too much of a hassle. As long as the API gives me access to the text of the file, I shouldn’t have to make too many modifications.
I’m adding support for markdown formatting in the next release (so you can use bold, italics etc). It might be possible to auto-embed images as well, though I haven’t started working on that.
@Pseudonium: so if you have amended a card between the START and END, and you then run the script for a 2nd time on the file, it will not pick up those changes. Correct?
Peters-MacBook-Air:Obsidian_to_Anki-master peter$ python3 obsidian_to_anki.py -f /Volumes/NO\ NAME/Test/Commercial\ art.md
Loading configuration file...
Loaded successfully!
Reading file /Volumes/NO NAME/Test/Commercial art.md into memory...
Traceback (most recent call last):
File "obsidian_to_anki.py", line 576, in <module>
App()
File "obsidian_to_anki.py", line 394, in __init__
self.target_deck = App.DECK_REGEXP.search(self.file).group(0)
AttributeError: 'NoneType' object has no attribute 'group'
Please note the .py needs to be included in the command - it is not in your instructions.
Now, after running the script I looked in Anki and did not find the new card.
Here is the full text of the Obsidian file:
---
Author: Hugh McLeod
Book: , p.
Original number: n47
Site: [Brain Pickings](https://www.brainpickings.org/index.php/2012/02/27/purpose-work-love/)
Transcluded in:
Note creation date: 2014-08-25
---
Tags: #creativity #wealth #commercialisation
---
> Art suffers the moment other people start paying for it.
*<!--PB:-->Lewis Hyde [[Creative labour|agrees]]*.
The reason is that when you start doing it to make money, you’re starting to kill yourself artistically. - [source](https://www.brainpickings.org/2014/05/13/pete-seeger-paul-zollo-songwriters-on-songwriting/)
<br>
<br>
<br>
<br>
START
Basic (and reversed)
Commercial art: when does it suffer?
Back: when people start paying for it
END
<br>
*Footnotes*
@Klaas I see the problem. You are describing the note type as ‘Basic (and reversed)’ - Anki actually stores it as ‘Basic (and reversed card)’.
If you’d like to refer to it as ‘Basic (and reversed)’, here’s what I suggest:
Try running python3 obsidian_to_anki.py -c - this should open up the config file for editing. If that doesn’t work, you’ll have to navigate to the config file yourself.
Once you’ve got the config file open, navigate to the section that says [‘Note Substitutions’]. It should be at the end of the file