|
| 1 | +--- |
| 2 | +title: "Manual Test: Mermaid SVG with PDF - External Tooling" |
| 3 | +format: |
| 4 | + pdf: |
| 5 | + mermaid-format: svg |
| 6 | + keep-tex: true |
| 7 | +--- |
| 8 | + |
| 9 | +## Purpose |
| 10 | + |
| 11 | +This document is for **manual testing** of mermaid-format:svg with PDF output, |
| 12 | +specifically to verify behavior with different external tooling configurations. |
| 13 | + |
| 14 | +**Why manual?** Automated CI tests cannot easily verify: |
| 15 | +- Actual PDF generation with rsvg-convert |
| 16 | +- Inkscape fallback behavior |
| 17 | +- Platform-specific tooling issues (especially Windows) |
| 18 | +- Full conversion pipeline end-to-end |
| 19 | + |
| 20 | +## Simple Diagram |
| 21 | + |
| 22 | +```{mermaid} |
| 23 | +graph TD |
| 24 | + A[Start] --> B{Decision} |
| 25 | + B -->|Yes| C[Good] |
| 26 | + B -->|No| D[Bad] |
| 27 | + C --> E[End] |
| 28 | + D --> E |
| 29 | +``` |
| 30 | + |
| 31 | +## Multi-line Labels (Clipping Test) |
| 32 | + |
| 33 | +This tests potential text clipping issues with multi-line labels: |
| 34 | + |
| 35 | +```{mermaid} |
| 36 | +graph TD |
| 37 | + A["Line 1<br/>Line 2<br/>Line 3"] --> B["Another<br/>Multi<br/>Line<br/>Label"] |
| 38 | + B --> C["Final<br/>Node"] |
| 39 | +``` |
| 40 | + |
| 41 | +## Manual Testing Checklist |
| 42 | + |
| 43 | +### Test 1: With rsvg-convert (Default) |
| 44 | +- [ ] Ensure `rsvg-convert` is on PATH |
| 45 | +- [ ] Run: `quarto render mermaid-svg-pdf-tooling.qmd` |
| 46 | +- [ ] Verify: INFO message includes "requires external tooling" |
| 47 | +- [ ] Verify: PDF generates successfully |
| 48 | +- [ ] Check `.tex` file for `\includesvg` commands |
| 49 | +- [ ] Verify: No script tags in LaTeX output |
| 50 | +- [ ] Open PDF: Diagrams render correctly |
| 51 | + |
| 52 | +### Test 2: Without rsvg-convert |
| 53 | +- [ ] Remove rsvg-convert from PATH or rename binary temporarily |
| 54 | +- [ ] Run: `quarto render mermaid-svg-pdf-tooling.qmd` |
| 55 | +- [ ] Verify: INFO message about tooling requirement |
| 56 | +- [ ] Verify: Error about missing rsvg-convert |
| 57 | +- [ ] Expected behavior: Render fails with clear error |
| 58 | + |
| 59 | +### Test 3: Inkscape Fallback (use-rsvg-convert: false) |
| 60 | +Create variant document with: |
| 61 | +```yaml |
| 62 | +format: |
| 63 | + pdf: |
| 64 | + mermaid-format: svg |
| 65 | + use-rsvg-convert: false |
| 66 | + pdf-engine-opt: ["-shell-escape"] |
| 67 | + keep-tex: true |
| 68 | +``` |
| 69 | +
|
| 70 | +- [ ] Ensure Inkscape is installed |
| 71 | +- [ ] Run render with above config |
| 72 | +- [ ] Verify: INFO message about tooling |
| 73 | +- [ ] Verify: PDF generates via Inkscape (check logs) |
| 74 | +- [ ] Check `.tex` file: uses `\includesvg` with Inkscape |
| 75 | +- [ ] Open PDF: Diagrams render correctly |
| 76 | + |
| 77 | +### Test 4: Windows-Specific |
| 78 | +- [ ] Test on Windows with rsvg-convert (if available via Scoop/other) |
| 79 | +- [ ] Test on Windows without rsvg-convert |
| 80 | +- [ ] Test Inkscape fallback on Windows |
| 81 | +- [ ] Document any Windows-specific issues |
| 82 | + |
| 83 | +### Test 5: Comparison with PNG (Control) |
| 84 | +Create variant with `mermaid-format: png`: |
| 85 | + |
| 86 | +- [ ] Run: `quarto render` with png format |
| 87 | +- [ ] Verify: NO warning about external tooling |
| 88 | +- [ ] Verify: PDF generates successfully |
| 89 | +- [ ] Quality comparison: SVG vs PNG in final PDF |
| 90 | + |
| 91 | +## Expected Results Summary |
| 92 | + |
| 93 | +| Scenario | Warning | PDF Generation | Notes | |
| 94 | +|----------|---------|----------------|-------| |
| 95 | +| rsvg-convert available | ✅ Yes | ✅ Success | Default path | |
| 96 | +| No rsvg-convert | ✅ Yes | ❌ Error | Clear error message | |
| 97 | +| Inkscape + shell-escape | ✅ Yes | ✅ Success | Fallback works | |
| 98 | +| PNG format | ❌ No | ✅ Success | No tooling needed | |
| 99 | + |
| 100 | +## Platform-Specific Notes |
| 101 | + |
| 102 | +### Linux/Mac |
| 103 | +- rsvg-convert typically available via package managers |
| 104 | +- `librsvg` package usually includes rsvg-convert |
| 105 | +- Inkscape widely available |
| 106 | + |
| 107 | +### Windows |
| 108 | +- rsvg-convert NOT easily available (complex setup) |
| 109 | +- Can use Scoop: `scoop install rsvg-convert` (if r-bucket configured) |
| 110 | +- Inkscape available but requires shell-escape configuration |
| 111 | +- Most users should prefer PNG format on Windows |
| 112 | + |
| 113 | +## Recording Results |
| 114 | + |
| 115 | +After completing manual tests, document results in the beads issue notes field |
| 116 | +for quarto-cli-idi. Include: |
| 117 | + |
| 118 | +- Platforms tested (OS, versions) |
| 119 | +- Which scenarios passed/failed |
| 120 | +- Any unexpected behavior |
| 121 | +- Screenshots if helpful |
| 122 | +- Recommendations for users |
| 123 | + |
| 124 | +## See Also |
| 125 | + |
| 126 | +- Automated test: `tests/docs/smoke-all/2025/11/10/13661.qmd` |
| 127 | +- DOCX test: `tests/docs/smoke-all/2025/11/14/mermaid-svg-docx.qmd` |
| 128 | +- Beads issue: quarto-cli-idi |
| 129 | +- GitHub issue: #13661 |
0 commit comments