1
0

vault backup: 2025-12-15 09:06:48
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 1m29s

This commit is contained in:
2025-12-15 09:06:48 +01:00
parent 9871babdd5
commit 1b03369877
3 changed files with 3250 additions and 20 deletions

3225
wip/anki-tentafrågor.csv Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -145,10 +145,15 @@ def main(root: Path, out: Path, mode: str = "anki"):
# second column contains the rendered answer followed by metadata HTML
details = answer_html + "\n\n" + meta_html
rows.append((question_html, details, category))
# construct Anki deck name: use category if present, otherwise fallback to 'FÖRELÄSNING'
deck_suffix = category if category else "FÖRELÄSNING"
deck_name = f"Biokemi::Johan D - Tentafrågor::{deck_suffix}"
# For Anki export, include deck as first column
rows.append((question_html, details, category, deck_name))
# write CSV with semicolon delimiter
out.parent.mkdir(parents=True, exist_ok=True)
with out.open("w", encoding="utf-8", newline="") as f:
f.write("#deck column 4\n")
writer = csv.writer(f, delimiter=";", quoting=csv.QUOTE_ALL)
# If exporting for Excel, add a header row matching the columns
if mode == "excel":