vault backup: 2025-12-15 09:06:48
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 1m29s
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 1m29s
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user