Notes - eevdriet/obsidian-anki GitHub Wiki
The notes that are import to/exported from Obsidian are a simplified version of an Anki note. Below are all properties that are set for a note in order to sync it between Anki and Obsidian
Typed properties
These are properties that the user explicitly specifies for the notes in their vault. They can be set from the import/export rules, within notes defined from a template or through HTML comments within the file.
Note type
The type of each note is always set in the export rule that allows the note to be exported. This is necessary because many settings for the rule are dependent on which note type is used.
Fields
For every note, at least one field must be set in the template or regex for it to be exported.
Deck & tags
The deck that a note will be exported to can be set in 3 different places:
- Within the note itself if it uses a template for its format.
In this case, the
{{Deck}}
pattern needs to be included in the template - Within the file that contains the note as a HTML comment, i.e.
<!-- File deck: {{Deck}} -->
. - From the export rule with the
Deck
setting
As you can see from the example, the plugin uses these guidelines in order to the determine the notes' deck.
Similarly, the tags that are added to a note can be set as follows:
- Within the note itself if it uses a template for its format.
In this case, the
{{Tags}}
pattern needs to be included in the template - Within the file that contains the note as a HTML comment, i.e.
<!-- File tags: {{Tags}} -->
. - From the export rule with the
Tags
setting
Generated properties
These are properties that are generated by ObsidiAnki to keep track of which notes have been synced with Anki.
- When a note is created in Anki, it is given a unique identifier to keep track of it and avoid duplicates.
This identifier is used in Obsidian to avoid duplicates in the vault as well.
On a successful import/export, an HTML comment
<!-- Note id: {{Identifier}} date: {{Date}}
with the identifier is added to the note:
el gato -> the cat #flashcard/spanish <!-- Note before exporting -->
el gato -> the cat #flashcard/spanish <!-- Note after exporting -->
<!-- Note id: 1750255647988 -->
- To keep track of note version within the Obsidian vault, a date stamp is added to the note on importing/exporting as well.
The date is updated on each new import/export with
<!-- Note {{import | export}} date: {{Date}}
:
el gato -> the cat #flashcard/spanish <!-- Note before exporting -->
el gato -> the cat #flashcard/spanish <!-- Note after export #1 -->
<!-- Note export date: 2025-01-01 01:00 -->
el gato -> the cat #flashcard/spanish <!-- Note after export #2 -->
<!-- Note export date: 2025-06-06 06:00 -->
<!-- Note start --> <!-- Note after import -->
Front: le chat
Back: the cat
<!-- Note import date: 2025-08-08 08:00 -->
<!-- Note end -->
- After notes are imported, you may want to re-import them but with a different template. In case you want to update the existing note, ObsidiAnki needs a way to match the old version. A set of delimiters is added for each imported note to accomplish this:
Deck: {{Deck}} <!-- Template to import a "Basic" note -->
Tags: {{Tags}}
{{Fields}}
<!-- Note start --> <!-- Note after import, note the "start" and "end" comments -->
Deck: Languages::French
Tags: language/french, language/word
Front: le chat
Back: the cat
<!-- Note end -->
Skipped properties
Some properties that cannot (currently) be set are:
- Which cards are exported for each note Currently AnkiConnect has no way of exporting only a subset of cards for a note type; all cards are exported when the note is exported.
- Review information from Anki on the note or cards, such as lapses, last review time or number of reviews