docs: use text-fragment anchors in README so methods land precisely#354
Merged
Conversation
…recisely The previous pass (#353) stripped line-number anchors as a brittleness fix, but the result linked every method to the bare genome.py file, which is not actually useful. Replaced bare-file links with text-fragment anchors (#:~:text=def%20name() that scroll to the method definition in modern browsers without depending on its line number. The trailing paren keeps "def genes(" from also matching "def genes_at_locus(". Class links use #:~:text=class%20Name( for the same reason. Also dropped the intro paragraph that apologized for the lack of precision - it was only needed when the links were imprecise. Docs-only; no version bump.
This was referenced May 13, 2026
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.
Summary
Follow-up to #353. That PR stripped
#Lnnnanchors because they drifted on every source change, but the result linked every method to the baregenome.pyfile — which doesn't actually navigate you to the method, just opens the file.Replaces bare-file links with text-fragment anchors (
#:~:text=def%20name(). Modern browsers honor these and scroll to the first match in the rendered page. Drift-resistant: works as long as the method'sdefline exists in the file, regardless of line number.The trailing
(is load-bearing:def geneswould otherwise also matchdef genes_at_locus. Same forclass Gene(vsclass GeneFoo((none today, but cheap insurance).Also removed the intro paragraph from #353 — it was an apology for the lack of precision and isn't needed now that the links land where they should.
Test plan
def genes(vsdef genes_at_locus((and the other prefix-collision pairs) verified uniqueCaveats
Text-fragment URLs are supported in Chrome / Edge / Firefox / Safari (Safari 16.4+). Older browsers fall back to opening the file at the top, which is no worse than #353's bare-file link.