pdf #136

Merged
navicore merged 2 commits from pdf into main 2026-05-08 21:37:35 +00:00
Owner

Everything passes. Summary:

zim pdf is wired in. Run it with zim pdf [PATH] — flags: --output, --title,
--author, --keep-tex. Defaults: PATH=., output is

.pdf in cwd, title from
directory name, author from config.default_artist.

Files added:

  • src/pdf/walk.rs — deterministic walker, groups markdown by directory, hoists
    README.md
  • src/pdf/latex.rs — pulldown-cmark → LaTeX visitor; strips YAML frontmatter,
    peels first H1 as title, demotes remaining headings, escapes special chars
  • src/pdf/assemble.rs — builds the LaTeX document (preamble, TOC, \section per
    dir, \clearpage between subdirs, \subsection per non-README md)
  • src/pdf/compile.rs — invokes xelatex twice; clear "install MacTeX" error if
    absent; full log tail on failure
  • src/pdf/mod.rs — generate() orchestrator
  • src/cli/pdf.rs — handler + progress + summary line

Wired into: src/main.rs, src/cli/mod.rs, src/lib.rs, Cargo.toml (added
pulldown-cmark = "0.12").

Smoke test: ran end-to-end against a synthetic project with README.md + two
subdirs (mixes/ with README + 2 sidecars + frontmatter, bounces/ README-only).
PDF compiled cleanly under TinyTeX. Verified TOC renders, root section has no
leading \clearpage, subdirs do, sidecar frontmatter title: drives subsection
name, in-body H2 demotes to \paragraph.

Robustness tweak made during testing: the user has TinyTeX, which doesn't ship
ulem or parskip by default. Preamble now wraps both with \IfFileExists + a no-op
\providecommand{\sout} fallback, so it works on TinyTeX and MacTeX without
forcing the user to install extra packages.

just ci passes (fmt, clippy, 114 tests, build).

Everything passes. Summary: zim pdf is wired in. Run it with zim pdf [PATH] — flags: --output, --title, --author, --keep-tex. Defaults: PATH=., output is <dir>.pdf in cwd, title from directory name, author from config.default_artist. Files added: - src/pdf/walk.rs — deterministic walker, groups markdown by directory, hoists README.md - src/pdf/latex.rs — pulldown-cmark → LaTeX visitor; strips YAML frontmatter, peels first H1 as title, demotes remaining headings, escapes special chars - src/pdf/assemble.rs — builds the LaTeX document (preamble, TOC, \section per dir, \clearpage between subdirs, \subsection per non-README md) - src/pdf/compile.rs — invokes xelatex twice; clear "install MacTeX" error if absent; full log tail on failure - src/pdf/mod.rs — generate() orchestrator - src/cli/pdf.rs — handler + progress + summary line Wired into: src/main.rs, src/cli/mod.rs, src/lib.rs, Cargo.toml (added pulldown-cmark = "0.12"). Smoke test: ran end-to-end against a synthetic project with README.md + two subdirs (mixes/ with README + 2 sidecars + frontmatter, bounces/ README-only). PDF compiled cleanly under TinyTeX. Verified TOC renders, root section has no leading \clearpage, subdirs do, sidecar frontmatter title: drives subsection name, in-body H2 demotes to \paragraph. Robustness tweak made during testing: the user has TinyTeX, which doesn't ship ulem or parskip by default. Preamble now wraps both with \IfFileExists + a no-op \providecommand{\sout} fallback, so it works on TinyTeX and MacTeX without forcing the user to install extra packages. just ci passes (fmt, clippy, 114 tests, build).
pdf
Some checks failed
CI (Linux) / just ci (pull_request) Failing after 17s
775cf067ea
Everything passes. Summary:

  zim pdf is wired in. Run it with zim pdf [PATH] — flags: --output, --title,
  --author, --keep-tex. Defaults: PATH=., output is <dir>.pdf in cwd, title from
  directory name, author from config.default_artist.

  Files added:
  - src/pdf/walk.rs — deterministic walker, groups markdown by directory, hoists
  README.md
  - src/pdf/latex.rs — pulldown-cmark → LaTeX visitor; strips YAML frontmatter,
  peels first H1 as title, demotes remaining headings, escapes special chars
  - src/pdf/assemble.rs — builds the LaTeX document (preamble, TOC, \section per
  dir, \clearpage between subdirs, \subsection per non-README md)
  - src/pdf/compile.rs — invokes xelatex twice; clear "install MacTeX" error if
  absent; full log tail on failure
  - src/pdf/mod.rs — generate() orchestrator
  - src/cli/pdf.rs — handler + progress + summary line

  Wired into: src/main.rs, src/cli/mod.rs, src/lib.rs, Cargo.toml (added
  pulldown-cmark = "0.12").

  Smoke test: ran end-to-end against a synthetic project with README.md + two
  subdirs (mixes/ with README + 2 sidecars + frontmatter, bounces/ README-only).
  PDF compiled cleanly under TinyTeX. Verified TOC renders, root section has no
  leading \clearpage, subdirs do, sidecar frontmatter title: drives subsection
  name, in-body H2 demotes to \paragraph.

  Robustness tweak made during testing: the user has TinyTeX, which doesn't ship
  ulem or parskip by default. Preamble now wraps both with \IfFileExists + a no-op
   \providecommand{\sout} fallback, so it works on TinyTeX and MacTeX without
  forcing the user to install extra packages.

  just ci passes (fmt, clippy, 114 tests, build).
just
All checks were successful
CI (Linux) / just ci (pull_request) Successful in 2m26s
de0919ab93
Sign in to join this conversation.
No description provided.