Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Explain leading dot in object references #27945

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

timhoffm
Copy link
Member

No description provided.

@github-actions github-actions bot added the Documentation: devdocs files in doc/devel label Mar 18, 2024
Comment on lines 321 to 322
the leading dot, otherwise Sphinx will try to resolve the object only in the current
module. See also the explanation at `Sphinx: Cross-referencing Python objects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, I'm not sure what this means, feel like either it needs more detail (short example) or should be left out

Suggested change
the leading dot, otherwise Sphinx will try to resolve the object only in the current
module. See also the explanation at `Sphinx: Cross-referencing Python objects
the leading dot, as discussed in `Sphinx: Cross-referencing Python objects

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in a sphinx page you can set a "current module", if you don't use the . it looks for the name in that module, if you use the dot it will look anythere in your project.

I think this is clear enough as-is and removing this bit of the text makes this PR mostly content-less.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is clear enough as-is

You also already knew what it was getting it, while I didn't and found this explanation hard to follow. Granted, I think the explanation you just wrote "if you don't use the . it looks for the name in that module, if you use the dot it will look anythere in your project." is what I was after.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded to

Note that you should typically include
the leading dot. It tells Sphinx to look for the given name in the whole project.

@story645 story645 added this to the v3.9.0 milestone Mar 19, 2024
@story645 story645 merged commit 9dd9cb4 into matplotlib:main Mar 19, 2024
22 checks passed
@timhoffm timhoffm deleted the doc-cross-ref branch March 20, 2024 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: devdocs files in doc/devel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants