feat(anki): custom preamble per directory

This commit is contained in:
arne314
2024-12-24 13:22:09 +01:00
parent b0d8031a8e
commit 1f2bc8e486
6 changed files with 61 additions and 132 deletions

View File

@@ -10,6 +10,7 @@ class Flashcard:
deck: str
id_updated: bool
preamble: str
file_handler: FileHandler
note_id_node: tree_sitter.Node
@@ -19,7 +20,7 @@ class Flashcard:
svg_front: bytes
svg_back: bytes
def __init__(self, front: str, back: str, deck: str | None, note_id: int, file_handler: FileHandler):
def __init__(self, front: str, back: str, deck: str | None, note_id: int, preamble: str, file_handler: FileHandler):
if deck is None:
deck = "Default"
if not note_id:
@@ -28,8 +29,9 @@ class Flashcard:
self.back = back
self.deck = deck
self.note_id = note_id
self.id_updated = False
self.preamble = preamble
self.file_handler = file_handler
self.id_updated = False
def __str__(self):
return f"Flashcard(id={self.note_id}, front={self.front})"