Repository navigation
1.16 part 12/18: Almanac: the book as a PDF, Almanac HD and the Golden Record - #183
Closed
epheterson wants to merge 1 commit into
Closed
epheterson wants to merge 1 commit into
epheterson wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Sorry @epheterson, your pull request is larger than the review limit of 150,000 diff characters |
epheterson
force-pushed
the
line/1.16.0-11-almanac-page
branch
from
November 23, 2026 10:07
8d0916f to
b6b2e5a
Compare
epheterson
force-pushed
the
line/1.16.0-12-almanac-book-hd
branch
from
November 23, 2026 10:07
f6719e6 to
a82ebed
Compare
epheterson
force-pushed
the
line/1.16.0-11-almanac-page
branch
from
November 23, 2026 10:12
b6b2e5a to
5c6a4ad
Compare
epheterson
force-pushed
the
line/1.16.0-12-almanac-book-hd
branch
from
November 23, 2026 10:12
a82ebed to
e335882
Compare
epheterson
force-pushed
the
line/1.16.0-11-almanac-page
branch
from
November 23, 2026 10:52
5c6a4ad to
387e48d
Compare
epheterson
force-pushed
the
line/1.16.0-12-almanac-book-hd
branch
from
November 23, 2026 10:52
e335882 to
98d1b9e
Compare
epheterson
force-pushed
the
line/1.16.0-11-almanac-page
branch
from
November 23, 2026 16:37
387e48d to
4dfe97a
Compare
epheterson
force-pushed
the
line/1.16.0-12-almanac-book-hd
branch
from
November 23, 2026 16:37
98d1b9e to
193d2a9
Compare
epheterson
force-pushed
the
line/1.16.0-11-almanac-page
branch
from
November 23, 2026 16:44
4dfe97a to
eace8c2
Compare
epheterson
force-pushed
the
line/1.16.0-12-almanac-book-hd
branch
from
November 23, 2026 16:45
193d2a9 to
1182462
Compare
Owner
Author
|
Reviewed here; included in the release PR #189. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 12 of 18 of Zimi 1.16.0: Almanac: the book as a PDF, Almanac HD and the Golden Record. Base:
line/1.16.0-11-almanac-page(part 11); the diff shows only this part's files. The PR carries thenot-a-releaselabel and the version stays 1.15.7, so merging it cuts no release. Merge in order (1 to 17, then 18) with a merge commit, not a squash.What this is
Three things the Almanac needs off the page. The book of tables is typeset as a PDF by the server without a browser. Almanac HD is fetched once, in two sizes, from the release. The Golden Record pictures become WebP with a credit for each. The Almanac ZIM's own source is also updated; the built ZIM lands on top of part 16.
What changes
zimi/almanacbook.py(new): lays out the book's HTML with PyMuPDF's HTML engine (Story) in Charis SIL, then draws running heads and feet, contents page numbers with dotted leaders, links, the outline, and small vector pictures.render(html, paper)returns the PDF bytes.zimi/almanacmath.py(new): lays out Presentation MathML (Temml's output) in Noto Sans Math and draws it onto a PDF page as embedded text, with TeX-style script sizes, fractions on the maths axis and fences stretched to their content. It refuses DOCTYPEs and entities.zimi/almanacpdf.py: the browser-driven PDF path is replaced. A render runs as its own process (python -m zimi.almanacbook) under a time limit, one at a time with a short queue behind it (past that the server answers busy), and the same document asked again returns the PDF already made. A frozen desktop build renders on the request's thread.zimi/almanachd.py: Almanac HD is one ZIM,zimi_almanac_maxi_<month>, in two sizes, one installed at a time: HD (one release file) and Maximum (zimsplit chunks fetched into a hidden staging folder, each checked against its sha256, the whole book checked before it replaces HD). Reading the release manifest is part of the Ask first, Automatically or Never setting;ZIMI_OFFLINEis Never. Older copies are listed, not deleted.scripts/build_almanac_hd.py,scripts/build_almanac_maxi.py: tiles are cut at each source's native resolution (nothing magnified), with Cassini moon and Phobos tone tables, hole filling and shaded terrain maps added, and the two flavours are built from a pinned tile source.scripts/publish_almanac_tiles.py(new) packs, splits, checks and pins that source; it uploads only with--upload.zimi/assets/almanac-tiles.jsongainshd_sizeandmax_size;.github/workflows/almanac-hd.ymlnotes the memory the build needs and addstifffile.scripts/verify_almanac_qids.py: audits each curated Q-ID against English Wikipedia (wrong item, disambiguation page, missing page);--landmarksauditszimi/static/earth/landmarks-v1.jsonagainst Wikidata and checks every link keyalmanac-earth.jsasks for, exiting 1 so it can gate a release.zimi/static/golden-record/*.webpreplace the.giffiles;credits.jsonnames each picture's owner and whether it is public domain.zimi/builtin/almanac/index.html,local.js,zimi.txt: the ZIM's page loads its scripts in order with a retry for a busy server (kiwix-serve), serves the all-satellites snapshot, drops the old credit line, and the title becomes "Zimi Almanac".How to review
almanacpdf.py(the subprocess, time limit and queue: a hang or leak holds the server), thenalmanachd.py(consent before any network read, the sha256 checks, what is removed when a size replaces the other).almanacmath.pylayout(the parser handles client-sent text) andalmanacbook.pyrender(fetches nothing; images come only from the book's own archive).almanachd.py(HD and Maximum swap, older copies never deleted unasked), network calls (manifest and chunk fetches), and a PDF render's memory and time on a long book.golden-record/*.webp(binary),tests/test_almanac_hd_sizes.pybeyond its docstring.tests/test_older_copies_delete.pyfirst passes at this tip (Storage's "Older copies" Delete is the HD change). The ZIM'sindex.htmlloads scripts that land in parts 13 to 16.Tests
tests/test_almanac_pdf.py(the/almanac/pdfroute: size limit, nothing fetched, one render at a time in its own process killed at its time, the file removed after its time, 501 where PyMuPDF is missing).tests/test_almanac_hd.py,tests/test_almanac_hd_sizes.py,tests/test_older_copies_delete.py,tests/test_almanac_zim_size.py.tests/test_almanac_hd_browser.py,tests/test_almanac_hd_climb_browser.py,tests/test_almanac_hd_holes_browser.py.tests/test_own_zims_kiwix_serve.py(skips withoutkiwix-serveunless CI requires it).tests/test_almanac_qids.cjs. Tests named for this part that first pass in parts 16 and 17: the HD build, release and workflow tests, the ZIM and Golden Record tests.Summary by cubic
Typesets the Almanac's book as a PDF without a browser, makes Almanac HD one ZIM in two sizes installed one at a time, and serves the Golden Record pictures as WebP with credits for each.
PDF
zimi/almanacbook.pydraws the running heads and feet, contents page numbers with dotted leaders, links, the outline, and vector pictures;zimi/almanacmath.pytypesets Presentation MathML in Noto Sans Math as embedded, subsetted text.Almanac HD
zimi_almanac_maxi_<month>, one release file, some layers cut short to fit it) and Maximum (zimi_almanac_ultra_<month>, zimsplit chunks fetched into a hidden staging folder), each chunk checked against its sha256 with the whole book verified before it replaces the other.scripts/publish_almanac_tiles.pypacks, chunks and pins that source, and the two builds draw from it and a hand-built craft folder.scripts/verify_almanac_qids.pyaudits the curated Q-IDs against English Wikipedia and the 3D view's landmarks against Wikidata, exiting 1 so it can gate a release.kiwix-serve, serves the all-satellites snapshot, and a test holds the ZIM to its size budget by storing data files as a compressible type.Written for commit 1182462. Summary will update on new commits.