You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add direct anchors to regex syntax documentation #83156
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2019-12-04.21:12:31.099>labels= ['type-feature', 'docs']
title='Add direct anchors to regex syntax documentation'updated_at=<Date2019-12-09.21:41:44.691>user='https://github.com/bmispelon'
While writing documentation about regexps for a project I help maintain, I wanted to link to some specific aspects of Python's implementation (in my case, non-capturing groups) which are described on https://docs.python.org/3/library/re.html.
There are no visible ¶ anchors for the items in the "Regular Expression Syntax" section. Inspecting the generated HTML, there does seem to be auto-generated ids (like #index-16 for example) but I wouldn't like to rely on those as I'm not sure how stable they are.
I couldn't find how to add the ¶ symbol show up next to the titles but I have a PR that adds a bunch of references so that items can be linked directly.
¶ anchors are generated automatically for headers, but I don't know what the policy might be for items within section. It might be useful to add some subsection headers within the Regular Expression Syntax section.
bmispelon commented on Dec 9, 2019
bmispelonmannequin
MannequinAuthor
More actions
I've tried using subsection (level 3) for each syntax element and I'm not sure it's a big improvement.
Pros:
Visible ¶ anchors which make it easier to copy/paste a reference link
Cons:
<h3> headings have a slightly different style (bigger font, no background color)
All the added titles show up in the table of content (might not be a problem)
Lots of re-indenting is needed which makes the diff quite noisy (even without reflowing the paragraphs)
I'm not sure what's the best way to share this alternative. A new PR? An extra commit on the existing PR?
Activity
bmispelon commentedon Dec 4, 2019
While writing documentation about regexps for a project I help maintain, I wanted to link to some specific aspects of Python's implementation (in my case, non-capturing groups) which are described on https://docs.python.org/3/library/re.html.
There are no visible ¶ anchors for the items in the "Regular Expression Syntax" section. Inspecting the generated HTML, there does seem to be auto-generated ids (like
#index-16for example) but I wouldn't like to rely on those as I'm not sure how stable they are.I couldn't find how to add the ¶ symbol show up next to the titles but I have a PR that adds a bunch of references so that items can be linked directly.
terryjreedy commentedon Dec 6, 2019
¶ anchors are generated automatically for headers, but I don't know what the policy might be for items within section. It might be useful to add some subsection headers within the Regular Expression Syntax section.
bmispelon commentedon Dec 9, 2019
I've tried using subsection (level 3) for each syntax element and I'm not sure it's a big improvement.
Pros:
Cons:
I'm not sure what's the best way to share this alternative. A new PR? An extra commit on the existing PR?
gh-83156: Add dedicated anchor for regexp syntax elements (#17470)
[3.14] gh-83156: Add dedicated anchor for regexp syntax elements (GH-…
[3.15] gh-83156: Add dedicated anchor for regexp syntax elements (GH-…