Repository navigation
fix(docs): inherited-member links resolve however the docs name the base class - #10
Merged
Merged
Conversation
…ase class A subclass page links its inherited members to the pages of the base class. The link used a full name built from a module that exposes the base, which missed when the subclass's module only imports it (lair's Inventory(BaseGrid), fips's FluxInversionPipeline(InversionPipeline)) and when the docs name the class by a re-export. 38 links in lair and 34 in fips pointed nowhere, shown as plain names. The template now links by the qualified name with a leading dot (`~.Class.member`), which Sphinx matches against the end of every documented name. In lair, fips and arl-met, no inherited link is dead (checked with nitpicky builds). A base class with no page of its own still leaves plain names, so api.rst says to list the base classes too.
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.
Fixes a bug in v1.1.0's API pages (#9).
A subclass page links the members it inherits to the base class's pages ("Inherited: From Base: a, b, c"). Each link used a full name built from a module that exposes the base class. That misses when the subclass's module only imports the base (
class Inventory(BaseGrid)withBaseGridimported from another module), or when the docs name the class by a re-export. The link then pointed nowhere and showed as plain text, with no warning outside nitpicky mode.Counted with nitpicky builds on the three packages that use it:
The links now use
~.Class.member. A leading dot makes Sphinx match the end of every documented name, so the page is found however the docs name the class. (Linking by the defining module's name did not work: Sphinx records that alias for the class but not for its members.)A base class with no page of its own still leaves plain names, so
docs/api.rstnow says to list the base classes too.just testpasses for both variants.After this merges, a v1.1.1 tag would let lair (a small PR) and fips (its v1.1.0 update, held for this) take it with
copier update.