📝 docs: nest nav, add tutorials & workflows, generate llms.txt#615
Merged
Conversation
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.
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.
Merging this PR will not alter performance
Comparing Footnotes
|
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.
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.
for more information, see https://pre-commit.ci
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.
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.txtpair 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-designfor the landing-page card grid,sphinx-sitemap,sphinxext-opengraph,sphinx-notfound-page,sphinx-last-updated-by-git,sphinx-codeautolinkto link names in the runnable examples to the reference, and the builtinlinkcodewired to GitHub source. A build-time extension replaces the two staticllms.txtfiles: it walks the toctree, reads each page's title and first paragraph, and writes a curatedllms.txtand a fullllms-full.txtinto 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 newsphinx-lintpre-commit hook anddocs-linkchecktox env guard the prose. A final pass runs the wholedocs/tree through the house no-slop rules.