Tighten the docs, and stop testing them editorially - #17
Merged
Merged
Conversation
The docs were shortened by hand to cut implementation detail. Checking the result against the code turned up several places where the shortening had changed a claim into a false one: - The CSV's `representation` column was described as how a residue is drawn. It is additive: `annotation_rows` sets `extra_rep` alongside `base_rep`, and `docs/spec.md` still said "added on top", so the two pages contradicted each other. That additivity is what produces cartoon-plus-sticks. - `docs/csv-schema.md` said every residue without a row takes `default_color`. The `het_layer` components deliberately get no color node, so an unlisted ligand, ion or glycan keeps element coloring or its SNFG symbol. - `docs/examples.md` called `d-3-1-to-d-3-1-1.csv` "12 sites". It is 12 rows over 4 sites, one per protomer; same error in the row below it. - `docs/index.md` said residues are styled from a YAML file. They are styled from the CSV; the YAML is the spec that names it. - The Labels checkbox appears when a label was actually *drawn*, not whenever the CSV asks for one -- a row naming a residue the view excludes draws nothing and is reported as a warning. - `assembly` was marked "(default) au" although it is a required top-level key, and the orientation section no longer said which of its four keys are required. Also restores the one-clause reason **Reset view** exists (a representation added from Mol*'s Components panel arrives uncolored), fixes a broken bold marker and several typos, and rewraps to the ~90 columns the rest of docs/ uses. Anchor validation moves from a hand-rolled test to mkdocs' own `validation.links.anchors`, which resolves anchors from the rendered HTML and so also covers the mkdocstrings headings on python-api.md that the test's slugify approximation could not see. That removes `_heading_anchors`, its sweep, and a "negative control" that asserted docs/spec.md contained a specific link -- pinning an editorial choice, so cutting one sentence failed a test with nothing actually wrong. It also did not exercise the regex it claimed to guard. The same content-pinning assertion is dropped from the repo-link control. CLAUDE.md gains the rule this follows. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Follows the hand-editing of
docs/to cut implementation detail. Checking the shortened prose against the code turned up several places where it had changed a claim into a false one.Accuracy fixes
representationcolumn is additive. It had been rewritten as "how residue is drawn", butannotation_rowssetsextra_repalongsidebase_rep, anddocs/spec.mdstill said "added on top" — the two pages contradicted each other. That additivity is what produces the cartoon-plus-sticks figure.default_color. Thehet_layercomponents deliberately get no color node, so an unlisted ligand, ion or glycan keeps Mol*'s element coloring or its SNFG symbol.docs/examples.md.d-3-1-to-d-3-1-1.csvwas called "12 sites"; it is 12 rows over 4 sites, one row per protomer. Same error in the row below it. Verified by counting unique residues.docs/index.mdsaid residues are styled from a YAML file. They are styled from the CSV; the YAML is the spec that names it.README.mdalready said CSV.assemblywas markedau"(default)" although it is a required top-level key, and the orientation section no longer said which of its four keys are required (position/targetare;up/radiusare not).Plus a broken bold marker (
**…*) in the H1 example intro, the typos (HTmL,esidue,hiddien, "are shown are hidden", "lastest"), and a rewrap to the ~90 columns the rest ofdocs/uses. Reset view gets back the one clause saying why it exists.Anchor validation moves to mkdocs
validation.links.anchors: warninmkdocs.ymlreplacestest_cross_page_anchors_resolveand the_heading_anchorshelper. MkDocs resolves anchors from the rendered HTML, so it also covers the mkdocstrings headings onpython-api.mdthat the hand-rolled slugify could not see. Verified it fails the build rather than passing silently:The check moves from the pytest job to the docs job;
docs.ymlalready builds onpull_request, so CI coverage is unchanged.That also removes a "negative control" asserting
docs/spec.mdcontained a specificinternals.md#…link. It pinned an editorial choice — cutting one sentence failed a test with nothing actually wrong — and it did not even exercise the regex it claimed to guard, matching a different pattern from the sweep's. The same content-pinning assertion (>= 10repo links in examples.md) is dropped from the repo-link control.tests/test_docs.py: 8 tests → 5. The three that catch genuinely silent breakage nothing else enforces (Mol\*escaping,blob/main/links,OPTION_DOCS→docs/spec.md) all stay.CLAUDE.mdgains the rule this follows.Verification
scripts/check.sh— 215 passed.scripts/build_docs.sh—mkdocs build --strictclean with anchor validation on.No changes to
config.ymlordata/; no renderer or template changes, so nothing about what gets rendered changes.🤖 Generated with Claude Code