Skip to content

docs: PDF output + docs CI validation (Phase 4+5 of N) - #124

Merged
gburd merged 3 commits into
masterfrom
docs/phase4-final
Jul 31, 2026
Merged

docs: PDF output + docs CI validation (Phase 4+5 of N)#124
gburd merged 3 commits into
masterfrom
docs/phase4-final

Conversation

@gburd

@gburd gburd commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Phase 4 — PDF (13 per-book PDFs)

Engine: pandoc(HTML) → weasyprint (rejected TeX: tectonic needs network, texlive heavy). Deterministic, reuses the HTML path, renders all books in ~3.5 min. Title page (project + live version from dist/RELEASE + copyright) + running header/footer via CSS paged-media. Books: api_c (655p), programmer_reference (370p), api_stl (257p), installation, upgrading, gsg_txn, gsg, collections, gsg_db_rep, bdb-sql, articles×2, porting — all title pages carry Berkeley DB 5.3.33. validate_pdf.py: 13/13 PASS.

Phase 5 — CI (.github/workflows/docs.yml)

Triggers: push→master, PRs touching docs-src/**, dispatch, weekly. Hard gates: build (HTML+man, 0 err) · no-loss (all 13 trees, 0 drops) · completeness (man_coverage.py --ci) · spelling · internal link-check (lychee, 14908 links / 0 errors) · man-lint (mandoc, 0 ERRORS / 787+ pages). Advisory: prose (write-good), external links (225 rotted — expected for decades-old docs). Best-effort/scheduled: PDF build+validate.

Completeness resolution: wrote real stub pages for the 2 genuinely-undocumented APIs (db_env_set_func_assert, db_env_set_win_security) → functions gate = 28/28 (100%); the 40 getter/vtable methods are a frozen allowlist (a NEW undocumented method fails CI).

Independently verified

1465 HTML + 789 man + 13 PDF built (all 5.3.33); no-loss gate PASS (13 trees); completeness gate PASS (28/28). Touched only docs-src/, docs.yml, flake.nix (devShell), 2 stub .md. Phase 6 (publish gh-pages) is next.

Honest tradeoffs: ~153 legacy prose typos baselined (fixing churns no-loss-protected content); spelling gate blocks only NEW typos. weasyprint over TeX (documented in PLAN.md).

gburd added 3 commits July 31, 2026 13:34
Implement build_pdf(): render each top-level book (2 API refs + 9 guides +
articles' 2 sub-books = 13 PDFs) to docs-build/pdf/<book>.pdf. Chapters are
concatenated in _meta.toml order (API refs: index first, then alphabetical);
a CSS title page carries the live version (dist/RELEASE, 5.3.33) + copyright,
with a running header/footer via CSS paged-media (_templates/pdf-print.css).

Engine: pandoc(html) -> weasyprint. Chosen over LaTeX because it needs no TeX
toolchain, is deterministic, and reuses the existing HTML path. All 13 books
render (api_c 655pp, programmer_reference 370pp, ...) in ~3.5 min total.

Also fixes two real bugs the link-check surfaced: pandoc_md_to_html now
rewrites cross-tree .md links (../../api/c/foo.md) to .html, and build_html
copies tree images (docs-src/<tree>/img/*) into the built site so <img> links
resolve.

Adds real stub pages for the 2 genuinely-undocumented public APIs
(db_env_set_func_assert, db_env_set_win_security) written from their db.h
prototypes + source comments, so the completeness gate can be a hard 100%.

flake.nix devShell gains the docs validation toolchain (weasyprint,
poppler-utils, mandoc, codespell, lychee, write-good) so CI matches local.
Add .github/workflows/docs.yml (modeled on ci.yml/fuzz.yml; nix devShell for
tool parity). Triggers: push to master, PRs touching docs-src/**, dispatch,
and a weekly schedule.

HARD gates (block PRs):
  - build: build.py --no-pdf (HTML + man, 0 errors) + self-check
  - no-loss: verify_all.py runs verify.py over all 13 migrated trees; fails on
    any content drop (retention < threshold or a code/section hard drop)
  - completeness: man_coverage.py --ci; 28/28 public functions documented, and
    every uncovered method must be on the frozen allowlist (a NEW undocumented
    API fails). Matcher also taught the dbsite/set_-drop DocBook stem shapes.
  - spelling: spellcheck.py runs codespell keyed on (path, word), baselined to
    the ~153 legacy typos so only newly-introduced typos fail
  - internal link-check: lychee --offline + lychee.toml (deferred-tree and
    un-migrated-asset links excluded); every migrated internal link must resolve
  - man-lint: mandoc -Tlint over all .3, 0 ERRORS

ADVISORY (continue-on-error): prose (write-good passive/wordiness counts).
BEST-EFFORT/scheduled: pdf build + validate_pdf.py (slow), external link-check.

Every command was dry-run inside 'nix develop' and passes.
am_second.md points at 'second.javas' (a malformed link to a Java API example
in the deferred java tree); the file is absent in the upstream DocBook too, so
it is a pre-existing dead link, not a migration regression. The flake-pinned
lychee 0.24.1 (what CI's nix develop uses) extracts it where an older lychee
did not, so add it to the exclude set. Full gate suite re-verified inside
'nix develop' (the exact CI env): 0 link errors, all gates pass.
@github-actions

Copy link
Copy Markdown

Coccinelle convention checks

No new violations. ✅

Resolved since baseline (2) -- update dist/cocci/baseline.txt to lock these in.
rule_mutex_unbalanced|MUTEX_UNBALANCED|src/crypto/mersenne/mt19937db.c|return (ret);
rule_mutex_unbalanced|MUTEX_UNBALANCED|src/mp/mp_register.c|return (ret);

@gburd
gburd merged commit 59fc26c into master Jul 31, 2026
51 of 52 checks passed
@gburd
gburd deleted the docs/phase4-final branch July 31, 2026 17:43
@github-actions

Copy link
Copy Markdown

ABI diff vs v5.3.33 (libabigail — authoritative)

Removed exported symbols (nm -D, _NNNN version suffix normalized)

None.


Advisory: libabigail/nm is the authoritative binary-ABI check; Coccinelle is complementary source-level early warning. See dist/cocci/README.md.

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