Skip to content

Fix global CONTRIBUTING link #5737

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
May 20, 2025
Merged

Fix global CONTRIBUTING link #5737

merged 1 commit into from
May 20, 2025

Conversation

strugee
Copy link
Contributor

@strugee strugee commented May 18, 2025

Fixes the live contributing guidelines link, which just links to https://flask.palletsprojects.com/en/stable/contributing/_contrib (i.e. it puts the RST slug in the URL somehow).

I wrapped to 80 characters, let me know if that's incorrect.

@davidism
Copy link
Member

Please fix this using the named link syntax, inline links on large phrases are too hard to read/edit later.

@davidism davidism added the docs label May 18, 2025
@strugee
Copy link
Contributor Author

strugee commented May 18, 2025

Will try - I looked at the reStructuredText reference while I was writing the patch earlier and couldn't understand how to actually do this. Happy to look again/harder though.

@strugee
Copy link
Contributor Author

strugee commented May 19, 2025

@davidism fixed!

@davidism
Copy link
Member

Sorry, I didn't communicate what I was looking for well. I want you to fix the existing syntax, not change to inline or to a full reference. I want to keep the short reference name.

@davidism
Copy link
Member

I think it might be switching from <_contrib> to <contrib_>? It looks like that in a few other places in the docs.

@strugee
Copy link
Contributor Author

strugee commented May 19, 2025

Ohhh, I didn't realize there were other references - not super familiar with rST. Will grep when I'm back in the sprints room!

@strugee
Copy link
Contributor Author

strugee commented May 19, 2025

Or feel free to just fix the patch yourself/do it yourself on the off chance it's causing confusion in the Pallets sprint room

@strugee
Copy link
Contributor Author

strugee commented May 19, 2025

@davidism should finally be what you want, thanks for working with me!

@davidism davidism merged commit a42c4d5 into pallets:stable May 20, 2025
2 checks passed
@strugee strugee deleted the patch-1 branch May 20, 2025 20:13
@gmilde
Copy link

gmilde commented Jun 3, 2025

@strugee @davidism

Please fix this using the named link syntax, inline links on large phrases are too hard to read/edit later.

IMO, in this use case the anonymous link syntax is best suited:

See the Pallets `detailed contributing documentation`__ for many ways
to contribute, including reporting issues, requesting features, asking or
answering questions, and making PRs.

__ https://palletsprojects.com/contributing/

The named hyperlink syntax makes only sense, if you want to (re-)use the reference name in a simple link somewhere else.

@davidism
Copy link
Member

davidism commented Jun 3, 2025

I don't understand anonymous links, their documentation is lacking. How does this work if there are multiple links on a page? Also, occasionally we do reference the same link multiple times, so defaulting to that style makes more sense to me.

@gmilde
Copy link

gmilde commented Jun 4, 2025

I don't understand anonymous links, their documentation is lacking. How does this work if there are multiple links on a page?

Anonymous hyperlinks are documented in the reStructuredText Markup Specification.
Similar to auto-numbered footnotes, they match by their position, e.g.

__ https://example.org/link-1.html

Text with link-1__, link-2__, and link-3__.

__ contrib_
__ the-file-linked-to-by-link-3.txt

Also, occasionally we do reference the same link multiple times, so defaulting to that style makes more sense to me.

You are right, if you re-use the "reference names" or prefer a large "target section" at the end of the document, "labeled" links are better suited.

Mark, however, the difference between

`detailed contributing documentation <contrib_>`_

and

`detailed contributing documentation <contrib_>`__

The first variant (with only one trailing underscore at the very end) registers the link text as "reference name" (label). This allows subsequent references to the same target without embedded alias like See the `detailed contributing documentation`_ for more info..

The second variant (with two trailing underscores) allows using the same link text for different links

For details, see `here <contrib_>`__ and `here <policy_>`__.

@davidism
Copy link
Member

davidism commented Jun 4, 2025

That's good to know, rST links are a lot more complicated than I already thought they were. Ultimately, we're moving to myst-parser and Markdown, so this problem will go away.

@gmilde
Copy link

gmilde commented Jun 5, 2025

That's good to know, rST links are a lot more complicated than I already thought they were. Ultimately, we're moving to myst-parser and Markdown, so this problem will go away.

IMV, the CommonMark Spec on hyperlinks is not less complicated than the corresponding reStructuredText Markup Specification. The problem is the misleading Sphinx rST primer.

Looking at the concrete use case, a rST source file with a single hyperlink with long link text, the best suited and really simple syntax is an anonymous link:

/flask/doc/contributing.rst:

Contributing
============

See the Pallets `detailed contributing documentation`__ for many ways
to contribute, including reporting issues, requesting features, asking or
answering questions, and making PRs.

__ https://palletsprojects.com/contributing/

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants