docs: migrate remaining trees + man-page generation (Phase 2+3 of N) - #120
Merged
Conversation
- extract.py: body-level fallback for div-less guide article pages (embedded/witold); derive source: front-matter path from SRC arg. - verify.py: fix three measurement bugs that undercounted retention - TAG regex now matches only real HTML tags (a bare \< in prose like operator\<= no longer swallows following words); gfm punct escapes (\_ \< \> ...) neutralized before tag-strip; code-fence counter now sees fences after list markers (1. ``` c). Add OLD/NEW dir args and a --selfcheck. C API tree goes 99.98% -> 100.00%, 0 hard drops. - migrate_tree.py: per-tree driver (extract + _meta.toml order from the index TOC + image copy). fix_xrefs.py: remap cross-tree links from the old docs/ layout to the new docs-src/ layout. - re-extract api/c under the corrected pipeline.
- build.py build_man(): every C/STL refentry .md -> a section-3 man page via pandoc -t man + _templates/man.tmpl. Reshapes the API schema (title/synopsis/description/Parameters/Errors/Class/See Also) into man sections (NAME/SYNOPSIS/DESCRIPTION/.SH ...): synthesizes NAME from the first description sentence, promotes ###->.SH / ####->.SS, demotes in-list headings to bold labels, and tidies the "PP after SS" roff. - libdb.3 overview synthesized from the C API index sidebar + a library DESCRIPTION (embedded, ACID, WAL, 4 access methods, multi-process) with API GROUPS + SEE ALSO. Content pulled from existing docs, not invented. - man.tmpl: libdb .TH skeleton; site.toml gains man_date (single source). - Output: docs-build/man/man3/*.3 (787 pages). mandoc -Tlint: 0 ERRORS (80 warnings are pandoc empty-autolink artifacts; STYLE = lowercase lib-function page names, conventional). - man_coverage.py: measure-only API coverage report (CI gate is phase 5). - build.py --selfcheck guards the md->man reshape. Leaves build_pdf() stub intact for phase 4.
Coccinelle convention checksNo new violations. ✅ Resolved since baseline (2) -- update dist/cocci/baseline.txt to lock these in. |
ABI diff vs
|
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.
Phase 2 + 3 of the documentation modernization (Phase 1 landed in #119). Everything is confined to
docs-src/;docs/and the gitignoreddocs-build/are untouched.Phase 2 — migrate the remaining doc trees
Ran the reverse-DocBook
extract.py+ theverify.pyno-loss gate on every tree. All 13 trees pass: >=99.98% mean word retention, 0 outliers, 0 hard drops.Pipeline changes (shared, regression-safe)
The extractor and gate needed generalizing for the chaptered guides. The C API tree was re-verified after every change and went from 99.98% -> 100.00%, so no regression:
source:front-matter derived from the SRC arg.TAGregex now matches only real HTML tags (a bare\<in prose likeoperator\<=no longer swallows the following words); gfm punctuation escapes (\_ \< \>) are neutralized before tag-stripping; the code-fence counter now sees fences after list markers (1. \`` c). Added OLD/NEW dir args +--selfcheck`._meta.tomlreading-order from the index TOC + image copy).docs/layout to the newdocs-src/layout (unmigrated CXX/TCL links intentionally left pointing at the archived tree).Layout: API trees ->
docs-src/api/{c,stl}/; guides ->docs-src/guides/<name>/, each with an_meta.tomland animg/for preserved images. gsg/gsg_txn/gsg_db_rep migrated from their C sub-variant (core-engine focus).Phase 3 — man pages
Implemented
build_man()in build.py. Every C/STL refentry.md-> a section-3 man page via pandoc +_templates/man.tmpl, mapping the API schema (Description/Parameters/Errors/Class/See Also) to man sections (NAME/SYNOPSIS/DESCRIPTION/.SH ...). Plus one synthesizedlibdb.3overview (NAME + a library DESCRIPTION — embedded, ACID, WAL, 4 access methods, multi-process — + API GROUPS + SEE ALSO, all pulled from existing content).*.3generated ->docs-build/man/man3/.mandoc -Tlint: 0 ERRORS across all 785 files. Remaining: 80 WARNINGs (pandoc empty-autolink.UR/.MTartifacts, inherent) + 773 STYLE (mostly lowercase page-name titles, conventional for library functions).libdb.3renders sensibly undermandoc.API coverage (measure-only; the CI gate is phase 5)
db.hmethod-pointer +ext_prot.infunction surface name-matches a page (viaman_coverage.py). The ~13% "unmatched" is not missing docs: 25 areget_*getters documented on theirset_*page, ~27 are paired setters /*_stat_printvariants / getters documented on a shared page. Only 2 are genuinely undocumented in the source:db_env_set_func_assert,db_env_set_win_security(Windows/debug setup functions Oracle never gave a page).Deferred: docs/csharp (38 MB) + docs/java (12 MB)
Assessed, deliberately not migrated. Neither is DocBook, so the extractor doesn't apply: csharp is a compiled Sandcastle/MS-Help-Viewer tree (
.chm/.aspx/JS, 2457 files, 1 real HTML); java is standard Javadoc (525 files). Both are language-binding docs, enormous, and lower-value for the core C engine. A future phase can regenerate them from source with their native doc tools.What later phases still need
build_pdf()stub left intact — pandoc per book + shared LaTeX header.docs.ymlwiringverify.pyper tree +man_coverage.pyas hard gates, plus spelling/link/man-lint.docs-build/html, update the landing page.Validation
cd docs-src && python3 build.py-> 1463 HTML + 787 man, 0 errors, version 5.3.33 throughout.mandoc -Tlint: 0 errors on all 785*.3.docs/untouched;docs-build/stays gitignored.