Skip to content

v2.2.0 — page layout options, folder builds, and links that open

Latest

Choose a tag to compare

@leonardosalasd leonardosalasd released this 13 Nov 00:22
7cd1c78

What's new

A folder of documents builds without ceremony. A folder with Markdown in it but no README.md used to refuse to build at all; the search now falls through to the first .md the folder lists, after the manifest and the README it already looked for. And --all gives every Markdown file in the folder its own PDF, which is what three unrelated reports want and the opposite of what the manifest does.

Margins, text alignment, and an optional table of contents. --margin takes a word for the usual amounts — tight, normal, wide — or a measurement such as 2cm when the amount matters. --align decides how body text sits in the measure: justify, left, right, center, applied to paragraphs only, so headings and the cover keep the arrangement the template designed for them. --no-toc leaves out the generated contents, and the page break that belongs to it, for a document that carries an index of its own. All three fall back to whatever the template does when nobody asks, and all three can be set in front matter and in .doc-engine.toml like every other option.

align on a raw HTML block is respected. A README that centres its banner with <div align="center"> keeps that arrangement in the PDF. <center> counts too, and a block left open at the end of a file is closed rather than breaking the build.

Fixes

  • A code block containing its own fence no longer kills the build. A file documenting Markdown — one with ``` inside a fenced block — failed with unclosed raw text, because the emitted Typst always opened with three backticks and the first run inside closed it early. The fence now grows past the longest run in the code.

  • Links that could not be opened now open. [text](#a-heading) was written out as a link to a path named #a-heading, so the reader looked for a file beside the PDF and reported it could not be opened. Headings now carry an anchor, named the way GitHub names its own and made unique when a title repeats, and such a link jumps inside the document. An anchor matching no heading drops the link and says so rather than producing one that errors. Separately, [text](example.com) has no scheme, so Markdown reads it as a relative path and the reader treated it as one; a target that is plainly a host, and is not a file the build can see, now gets https://.

  • A picture no longer strands the sentence that introduces it. A portrait photograph scaled to the full text block cannot share a page with anything, so a document of steps — a line of text, a screenshot, repeat — came out as alternating pages of text and picture. A picture is now allowed slightly less than the full height, which leaves room beside it, and the paragraph before one travels with it. The same treatment keeps an alert's label with the text it labels across a page break.

  • --dry-run reports footnotes with no definition. They are not a compiler error — the literal [^1] simply reaches the page looking like a typo — so the file was reported as clean. References written inside code, as this README writes them, are not counted.

  • Images in the README render on PyPI. The project page renders the README outside the repository, where the relative paths every screenshot used resolve to nothing. The publish job now rewrites them to raw GitHub, so the repository keeps the relative paths that let doc-engine embed its own screenshots.

Full Changelog: v2.1.0...v2.2.0

Install

pipx upgrade doc-engine-cli