Skip to content

DOC: Clarify the difference between document and section references #26405

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

Merged
merged 1 commit into from
Jul 30, 2023

Conversation

timhoffm
Copy link
Member

No description provided.

Directive Links target Representation in rendered HTML
========= =========================== ===========================================
``:doc:`` document link to a page
``:ref:`` ReST label (associated with link to an anchor associated with a heading
Copy link
Member

Choose a reason for hiding this comment

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

In line 225, this is called a section reference name and the way we name this thing should be consistent.
image

I vote for reference label since that's what sphinx calls em in their docs https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#cross-referencing-arbitrary-locations

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@timhoffm timhoffm force-pushed the doc-ref branch 2 times, most recently from 58a35aa to 2c2a7b9 Compare July 28, 2023 23:22
Copy link
Member

@story645 story645 left a comment

Choose a reason for hiding this comment

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

Can self merge or sort out parenthesis and then self merge.

Comment on lines 203 to 204
|ref-dir|_ reference label (associated link to an anchor associated with a heading
with a section)
Copy link
Member

Choose a reason for hiding this comment

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

I'm generally not a fan of these long parenthesis - what are we trying to get at here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Usually, I'm not a fan of parantheses here as well.

Motivation: The technical reference point is the label, but semantically we refer to the associated section. I wanted to

  • have the focus on the label, because that's what you have to specify in the role
  • also give the context that the label represents a section

The parantheses should lower the importance of the context information wrt to the label itself.

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 that info comes across in the where does it link information? And that we have an example underneath?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right. I've removed the parenthesis including its content.

@story645 story645 added this to the v3.7-doc milestone Jul 30, 2023
@story645 story645 added the Documentation: devdocs files in doc/devel label Jul 30, 2023
@story645 story645 merged commit c36a03f into matplotlib:main Jul 30, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 30, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 30, 2023
@timhoffm timhoffm deleted the doc-ref branch July 30, 2023 06:08
timhoffm added a commit that referenced this pull request Jul 30, 2023
…405-on-v3.7.2-doc

Backport PR #26405 on branch v3.7.2-doc (DOC: Clarify the difference between document and section references)
timhoffm added a commit that referenced this pull request Jul 30, 2023
…405-on-v3.7.x

Backport PR #26405 on branch v3.7.x (DOC: Clarify the difference between document and section references)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants