mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
feat(anki): nvim integration
This commit is contained in:
@@ -42,7 +42,7 @@ class AnkiConnectApi:
|
||||
update[card.deck].append(card)
|
||||
n_update += 1
|
||||
|
||||
print(f"Pushing {n_add} new flashcards and {n_update} updated flashcards to Anki...")
|
||||
print(f"Pushing {n_add} new flashcards and {n_update} updated flashcards to Anki...", flush=True)
|
||||
await self._create_required_decks({*add.keys(), *update.keys()})
|
||||
await self._add_new_cards(add)
|
||||
await _gather_exceptions(
|
||||
|
||||
@@ -32,7 +32,7 @@ async def export_flashcards(root_dir, force_scan, clear_cache, typst_cmd, anki_u
|
||||
# write id updates to files
|
||||
parser.update_ids_in_source()
|
||||
parser.save_file_hashes()
|
||||
print("Done")
|
||||
print("Done", flush=True)
|
||||
|
||||
|
||||
@cli.command()
|
||||
|
||||
@@ -108,7 +108,7 @@ class FlashcardParser:
|
||||
else:
|
||||
scan_dir = force_scan
|
||||
|
||||
print(f"Parsing flashcards in {scan_dir if single_file is None else single_file} ...")
|
||||
print(f"Parsing flashcards in {scan_dir if single_file is None else single_file} ...", flush=True)
|
||||
preambles = {}
|
||||
flashcards = []
|
||||
|
||||
@@ -158,7 +158,7 @@ class FlashcardParser:
|
||||
self.save_file_hashes()
|
||||
|
||||
def update_ids_in_source(self):
|
||||
print("Updating ids in source...")
|
||||
print("Updating ids in source...", flush=True)
|
||||
for fh, cards in self.file_handlers:
|
||||
file_updated = False
|
||||
for c in cards:
|
||||
|
||||
@@ -55,7 +55,7 @@ class TypstCompiler:
|
||||
card.set_svgs(front, back)
|
||||
|
||||
async def compile_flashcards(self, cards: List[Flashcard]):
|
||||
print(f"Compiling {len(cards)} flashcards...")
|
||||
print(f"Compiling {len(cards)} flashcards...", flush=True)
|
||||
semaphore = asyncio.Semaphore(self.max_processes)
|
||||
|
||||
async def compile_coro(card):
|
||||
|
||||
Reference in New Issue
Block a user