Skip to content

feat: configurable TOC page title, cover subtitle overflow fix, blank line spacing#14

Open
Hunter-Leo wants to merge 1 commit into
lovstudio:mainfrom
Hunter-Leo:feat/toc-title-customization
Open

feat: configurable TOC page title, cover subtitle overflow fix, blank line spacing#14
Hunter-Leo wants to merge 1 commit into
lovstudio:mainfrom
Hunter-Leo:feat/toc-title-customization

Conversation

@Hunter-Leo
Copy link
Copy Markdown

Summary

  • Configurable TOC page title: Replace hardcoded Chinese "目 录" with a configurable title that defaults to English "Contents". Supported via:
    • CLI argument --toc-title
    • Frontmatter keys toc-title or toc_title
  • Cover subtitle overflow fix: Add max_w constraint to subtitle rendering on the cover page, preventing long subtitles from overflowing the page right margin
  • Blank line spacing: Empty lines between paragraphs now produce vertical space instead of being silently skipped. Inside code blocks, blank lines remain preserved as-is
  • TOC header font: TOC page header right-side text now uses "Serif" font (matching the document body) instead of hardcoded CJK font
  • CHANGELOG.md: Add project changelog documenting all changes

Files Changed

File Change
lovstudio-any2pdf/scripts/md2pdf.py +15/-7 lines (2 fixes + 2 features)
lovstudio-any2pdf/SKILL.md Add --toc-title to config reference table
README.md Update feature list to mention TOC title
CHANGELOG.md New file
tests/09-toc-title-custom.md New test case for custom TOC title

Validation

  • npm test — 27 test PDFs generated successfully across all themes
  • --toc-title "Table of Contents" — custom title renders correctly
  • Frontmatter toc-title: 目 录 — custom title renders correctly

- Replace hardcoded Chinese "目  录" with configurable toc-title
- Add --toc-title CLI arg and toc-title/toc_title frontmatter support
- Fix cover subtitle overflow with max_w constraint
- Render blank lines between paragraphs as vertical space
- Add CHANGELOG.md and test case 09-toc-title-custom.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant