Skip to content

add print-on-demand edition of the PDF - #272

Draft
rpietzsch wants to merge 5 commits into
mainfrom
feature/print-on-demand
Draft

rpietzsch wants to merge 5 commits into
mainfrom
feature/print-on-demand

Conversation

@rpietzsch

Copy link
Copy Markdown
Contributor

add a print edition of the PDF: the book block of a printed book, built next to the screen PDF

💪 What

  • Adds task pdf:print (dec-tool build-pdf --edition print). It uses the same merge, pandoc run and fonts as task pdf, typeset as the interior of a perfect-bound book (BoD, A4, black and white). style.typ branches on --input edition=print; without it, the screen PDF builds as before.
  • Page furniture of a bound book:
    • mirrored margins, page numbers on the outer edge, and running titles
    • parts that start on right-hand pages, with blank pages left without header or footer
    • an even page count
  • Adds a title page as page 1 and an imprint with the publisher from tools/pdf/print.yml. Its author list lives in tools/pdf/authors.yml, refreshed from the GitHub contributors by task pdf:authors.
  • Paper cannot follow links: links within the book print the page they lead to, and links out of it print their address as a footnote.
  • Makes images and colours printable: copies at 300 ppi without transparency, and a black-and-white palette with no grey lighter than BoD's 20 % black.
  • Adds section modes in tools/pdf/print.yml (full, list, omit):
    • The Task and Operator Reference and the Release Notes print as list, their overview pages plus short tables.
    • The Transformers categories print as one Category | Transformers table instead of empty headings.
  • Wraps long code lines inside their frame in print.
  • In both editions:
    • A figure taller than the page scales down to fit, instead of running into the footer.
    • Image figures no longer carry a Typst number.
  • Fixes the Transformers reference table, which ended at the Excel map row on the website too. The reference generator now turns a fenced block in a plugin description into a code span, and the two affected lines of generated Markdown are regenerated.

🤔 Why

  • BoD needs a book block, not the screen PDF: 300 ppi images without transparency, printable greys, an even page count, and at most 1,200 A4 pages on 80 g paper. The screen PDF has 1683 pages; the print edition has 966.
  • Review of the first print build found these defects, all fixed here:
    • Broken Transformers table: it fell apart after Excel map. stripped_single_line squeezed the description's fenced block onto one line, and rumdl --fix (MD038) then inserted a blank line that ended the table.
    • Empty headings: list mode left the 24 operator categories as empty numbered headings, because the Transformers overview already lists their pages.
    • Long code lines: Typst does not break a long token such as a URL, so it ran past the code frame.
    • Tall figures: three IDS/OSINT tutorial screenshots print 26.8–28 cm tall at column width, taller than the 24.3 cm page body.
    • Doubled figure numbers: captions printed as Figure 15: Figure 2:. That tutorial numbers its figures in the caption text and refers to those numbers, and the website adds no numbering of its own.

👩‍🔬 How to validate

Needs pandoc 3.11 and typst 0.15.x.

task pdf:print    # writes dist/documentation-eccenca-com-<version>-print.pdf
task pdf          # the screen PDF
task pdf:authors  # refreshes tools/pdf/authors.yml; set GITHUB_TOKEN to avoid the rate limit

- Last run:
  - The print edition has 966 pages, about 165 MB.
  - The screen PDF has 1683 pages.
  - No page has content running into the footer.
  - No line runs past the text column.
- Screen PDF: each print-only change was compared against a baseline build and left the textes and document IDs. The screen PDF changes only in:
  - the Transformers table
  - the three tall figures
  - the figure captions
- Pages to look at in the print edition:
  - the A.3 reference ending in the Category | Transformers table
  - the wrapped code line in the IDS/OSINT tutorial (EventRecordID)
  - the three tall screenshots in the same tutorial
- Website: Build › Task and Operator Reference › Transformers is one table of 237 operators
- Tests: poetry run pytest -m "not integration" passes 100 tests.
- task check: rumdl, the navigation check and the output check pass. Locally, yamllint failatch/ folder. The link check logs an external apify.com error and does not fail on it.
- Open: backlog items P13–P17 (normalization pass, preflight report, low-resolution originals, CI, cover) are not part of this PR.

`task pdf:print` builds the book block for a printed book (BoD, A4,
black and white) next to the screen PDF, as planned in tasks/spec.md.

- mirrored page furniture, right-hand part starts, title page and imprint with an author list from `task pdf:authors`
- links printed as page references and footnotes, images at 300 ppi without transparency, a black-and-white palette
- tools/pdf/print.yml shortens the operator reference and the release notes to overview tables; reference categories print as one table
- long code lines wrap inside their frame
- both editions: tall figures scale to the page, image figures carry no Typst number
- fix the transformer reference table, which ended at the Excel map row: the generator turns a fenced block in a description into a code span
@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
1 files    0 ❌

Results for commit 4a3c3de.

♻️ This comment has been updated with latest results.

@rpietzsch
rpietzsch marked this pull request as draft September 15, 2026 09:10
The imprint listed contributors by their GitHub IDs.

- task pdf:authors stores each profile name in tools/pdf/authors.yml and adds new authors to authors.names in tools/pdf/print.yml
- print.yml names authors (with titles) and excludes IDs; excluded names are never looked up
- the build prints the given name, else the profile name, else the ID, and warns about each ID it prints
- use the GitHub CLI token when no token is set, and end a rate limit, a rejected token or a network error with a message
The print edition had no way to leave out single pages or parts of a page, and omit left a title and a note behind.

- print.yml keys may name a page; omit drops pages and subtrees without a trace
- the class print-exclude replaces a part of a page with a note pointing to the page online; the site and screen PDF are unchanged
- omit the cmem-client API and the OSINT tutorial, and the INSERT listing of the Snowflake tutorial: 966 to 666 pages
- spec §10 and backlog P18, authoring note in repo-conventions.md
@seebi

seebi commented Sep 15, 2026

Copy link
Copy Markdown
Member

open issues

  • footer: "A Build" -> "Part A: Build"
  • footnote references at the end of the document
  • regenerate statistic based on ignored content
  • material grid box height can maybe be aligned
  • build operators: chapter with descriptions and parmaters (but no examples) instead of overview tables
  • PDF/X-4, CMYK
  • image scaling (maybe directly in the sources) - calculate with DPI?

- left-hand footers name the part as "Part A: Build"
- web addresses become per-part endnote lists instead of footnotes
- the author order counts only commits to printed pages and images
- facing cards in a two-column grid share one height
- print the operator reference as compact entries from
  data/plugins.json: fields, description without examples, one
  parameter table and related operators, replacing the overview tables

The print edition grows from 666 to 870 pages; the screen PDF is
unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants