git » alan.git » commit da12529

Render Markdown via pandoc with gfm for cleaner PDFs

author Alan Dipert
2025-12-04 05:03:23 UTC
committer Alan Dipert
2025-12-04 05:03:23 UTC
parent a4b9efd8d3ff0fca102df03a535c2f0955a22f11

Render Markdown via pandoc with gfm for cleaner PDFs

README.md +1 -1
render_text.py +1 -1

diff --git a/README.md b/README.md
index b1306dd..5377878 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ cat answer_key.txt     # view the key
     --test-out test_booklet.txt --key-out answer_key.txt \
     --test-pdf test_booklet.pdf --key-pdf answer_key.pdf
   ```
-  If no PDF engine is available, the script will skip PDF generation and report the issue.
+  If no PDF engine is available, the script will skip PDF generation and report the issue. The booklet/key are rendered as Markdown, so bullets/headings convert cleanly to PDF when an engine is present.
 
 ## Generate Different Hardness Levels
 - **Standard (balanced):**
diff --git a/render_text.py b/render_text.py
index 9958dcc..77ba87a 100644
--- a/render_text.py
+++ b/render_text.py
@@ -92,7 +92,7 @@ def _write_pdf(text: str, pdf_path: str, title: str) -> None:
     last_error = None
     try:
         for eng in engines:
-            cmd = [pandoc, tmp_path, "-o", pdf_path]
+            cmd = [pandoc, tmp_path, "-o", pdf_path, "--from", "gfm"]
             if eng:
                 cmd.extend(["--pdf-engine", eng])
             try: