| 1 | Pure White Standard | Dark gray backgrounds waste ink and look muddy | Force @page { background: #FFFFFF; } and body { background-color: #FFFFFF !important; }. |
| 2 | Light Alabaster Code | Solid black terminal containers waste ink | Code containers must use #F8FAFC background with #CBD5E1 border and dark charcoal text #0F172A. |
| 3 | Syntax Theme (tango) | Dark themes (espresso, zenburn) force black code backgrounds | Strictly enforce --syntax-highlighting=tango for light-background compatibility. |
| 4 | Standalone Cover Injection | Raw Markdown covers break page layout and spill over | Author cover.html and inject via --include-before-body=cover.html. |
| 5 | Cover Single-Page Fit | Cover content spilling into Table of Contents | Enforce .cover-page { break-after: page; min-height: 250mm; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }. |
| 6 | Frontmatter Stripping | Pandoc crashes with Unknown alias error | Strip --- ... --- blocks from all ingested markdown files before concatenation. |
| 7 | Horizontal Rule Sanitization | \n---\n parsed by Pandoc as YAML start | Regex replace \n---\n with \n***\n in all ingested content. |
| 8 | GitHub Alert Card Conversion | > [!NOTE] renders as unstyled plain text | Programmatically transform into <div class="callout callout-note"><strong>💡 Note</strong><p>...</p></div>. |
| 9 | Self-Contained Embedded CSS | Headless browsers fail to resolve relative CSS links | Read terminal-theme.css and inject directly into <style> inside <head>. |
| 10 | Dynamic Backtick Scaling | Triple backticks inside code blocks close outer fence | Count max backticks in code and scale outer fence to N+1 (e.g. ````). |
| 11 | Heading Offset (+2) | Embedded guide titles collide with Book H1/H2 | Dynamically increment heading level (# to ###, ## to ####). |
| 12 | Native Vector SVG Baking | Client-side Mermaid race conditions in headless PDF | Pre-render diagrams to <svg> and inject into HTML before headless PDF execution. |
| 13 | Mermaid Namespace Isolation | Global node ID collisions across multiple diagrams | Prefix node IDs with unique namespace prefixes (TB_, AN_, TH_). |
| 14 | Pandoc Code-Tag Wrapping | Pandoc wraps <pre class="mermaid"><code> and escapes HTML | SVG replacement regexes must match both standard and <code>-wrapped pre blocks and unescape arrows (-->). |
| 15 | Windows Isolated Browser Profile | Edge crashes or hangs if user desktop instances are running | Launch Edge with --user-data-dir="$env:TEMP/edge-pdf-$(Get-Random)". |
| 16 | Synchronous Edge Execution | PowerShell returns before Edge finishes writing PDF | Always use Start-Process -FilePath $edge -ArgumentList ... -Wait. |
| 17 | Provenance Audit Banners | Loss of traceability for ingested runbooks | Inject <div class="doc-provenance"> detailing the repository source path. |