Skip to content

📝 docs: nest nav, add tutorials & workflows, generate llms.txt#615

Merged
gaborbernat merged 16 commits into
tox-dev:mainfrom
gaborbernat:docs/overhaul
Jul 8, 2026
Merged

📝 docs: nest nav, add tutorials & workflows, generate llms.txt#615
gaborbernat merged 16 commits into
tox-dev:mainfrom
gaborbernat:docs/overhaul

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

The documentation had grown to a flat left-nav of 39 how-to guides, 24 explanation pages, and 65 migration guides with no grouping, a hand-maintained llms.txt pair that already listed only half the how-tos, and a tutorial track that stopped at the string helpers while the real draw — scrape a page, pull the article, emit Markdown — had no learning path. 📚 This overhaul reorganizes the navigation, adds the tutorials and workflow recipes the competitor-usage mining surfaced, and makes the AI map and source links generate themselves so they cannot drift.

The left nav now groups every index by the same eight namespaces the reference already used (parse/DOM, detect, query, clean, convert, extract, build, serialize), a mechanical split of the existing flat toctrees with no page moved. A set of Sphinx extensions carries the polish: sphinx-design for the landing-page card grid, sphinx-sitemap, sphinxext-opengraph, sphinx-notfound-page, sphinx-last-updated-by-git, sphinx-codeautolink to link names in the runnable examples to the reference, and the builtin linkcode wired to GitHub source. A build-time extension replaces the two static llms.txt files: it walks the toctree, reads each page's title and first paragraph, and writes a curated llms.txt and a full llms-full.txt into the HTML root, so the map stays in step with the pages.

On top of the structure, the tutorial track grows from five pages to eleven with real-world walkthroughs, new workflow how-tos for the gaps the mining found (scrape-for-LLM, migrating off HTMLParser, feeds, page metadata, truncating), and a task-shaped troubleshooting page for the gotchas that trip newcomers. The README is refreshed to the current surface — XSLT, CSSOM, validation, streaming rewrite, forms, standalone detect, HTML+CSS minify, and the CLI — with a second quickstart for the parse→prune→Markdown workflow.

Every code block in the tutorials and how-tos runs under sphinx-build -W + doctest, and a new sphinx-lint pre-commit hook and docs-linkcheck tox env guard the prose. A final pass runs the whole docs/ tree through the house no-slop rules.

Add sphinx-design, notfound-page, sitemap, opengraph, last-updated-by-git,
codeautolink, reredirects, plus builtin linkcode and autosectionlabel. Wire
linkcode_resolve to GitHub source, replace the hand-rolled sitemap writer with
sphinx-sitemap, add the sphinx-lint pre-commit hook and a docs-linkcheck env.
Replace the two hand-maintained docs/_extra/llms files with a build-finished
Sphinx extension that walks the toctree, reads each page title and first
paragraph, and writes a curated llms.txt and a full llms-full.txt into the HTML
root, so the AI map cannot drift from the pages it lists.
@gaborbernat gaborbernat added the documentation Improvements or additions to documentation label Jul 8, 2026
Broaden the C-core page to the arena and subsystem map, add the parsed-tree
critical section and arena snapshot to free-threading, and add Detect and Build
explanation pages with their nav captions.
@codspeed-hq

codspeed-hq Bot commented Jul 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 91 untouched benchmarks
⏩ 18 skipped benchmarks1


Comparing gaborbernat:docs/overhaul (301270b) with main (4e6b1ce)

Open in CodSpeed

Footnotes

  1. 18 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Grow the tutorial track from five foundations to eleven with a Real-world
group: selecting, reading messy bytes, extracting content, forms, cleaning,
streaming/transform pipelines, and the CLI. Every code block runs under
doctest.
Add a Workflows nav group and five task recipes the competitor-usage mining
surfaced: scrape a page to Markdown for an LLM, migrate off html.parser,
read RSS/Atom feeds, read head metadata, and truncate HTML keeping tags
balanced.
Add a task-shaped troubleshooting how-to for the common first-session snags, a
sphinx-design card grid on the landing page, and refresh the README: stable doc
links, the full capability surface, the real 65-library migration count, and a
second parse-to-Markdown quickstart. Drop a stray trailing tag in the README.
Cut filler adverbs, an editorializing aside, and a rhetorical opener from the
pages this PR adds. The rest of the docs tree passes the slop-score gate and was
no-slopped when written.
Run bump-deps-index over the pins and let prek realign the formatting.
@gaborbernat gaborbernat marked this pull request as ready for review July 8, 2026 17:18
gaborbernat and others added 7 commits July 8, 2026 10:22
Read the Docs builds from a shallow clone, so sphinx-last-updated-by-git warns
that it cannot reach far enough back; under -W that failed the RTD build while
the full-clone CI docs job passed.
Hand-edit the 66 competitor migration guides for AI-writing tells: cut
significance-inflation framings, puff adjectives, and filler adverbs from the
narrative prose. API mappings, tables, and examples unchanged.
Order the functions top-down from setup, mark the module constants Final, and
tighten the docstring. Output is byte-identical.
Hand-edit the pre-existing how-to and explanation pages for AI tells: cut
significance-inflation openers and throat-clearing from the explanation prose
(sax, main-content, stdlib-parity, treebuild). The how-to pages were already
clean.
The how-to, tutorial, explanation, and migration sections each rendered as
one flat list in the sidebar because furo only shows toctree captions at the
root level. Give each topic a real index page that toctrees its own leaves, so
furo renders collapsible Section > Topic > page nodes. Leaf pages keep their
paths, so no URL changes.
@gaborbernat gaborbernat merged commit 61570c1 into tox-dev:main Jul 8, 2026
48 checks passed
@gaborbernat gaborbernat deleted the docs/overhaul branch July 10, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant