From 9dde623ef2c817fdacbd5b6272d5eb435c238417 Mon Sep 17 00:00:00 2001 From: McElwain Date: Fri, 1 May 2026 21:43:46 -0500 Subject: [PATCH] fix: support multiline annotation text from CSV --- app/annotate.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/annotate.py b/app/annotate.py index 8664305..30de556 100644 --- a/app/annotate.py +++ b/app/annotate.py @@ -25,7 +25,7 @@ def add_textbox(page, row): h = float(row["h"]) rect = fitz.Rect(x, y, x + w, y + h) - text = str(row["note_text"]) + text = str(row["note_text"]).replace("\\n", "\n") border_width = float(row.get("border_width", 1.5) or 1.5) box = page.add_rect_annot(rect) @@ -100,12 +100,14 @@ def generate_annotations(csv_path): def main(): parser = argparse.ArgumentParser(description="Generate PDF annotations from CSV data.") + parser.add_argument( - "csv", - nargs="?", + "-c", + "--csv", default=str(DATA_DIR / "annotations.csv"), - help="Path to annotations CSV file", + help="Path to annotations CSV file. Default: data/annotations.csv", ) + args = parser.parse_args() generate_annotations(Path(args.csv))