This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add direct anchors to regex syntax documentation
Type: enhancement Stage: patch review
Components: Documentation Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: bmispelon, docs@python, mdk, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2019-12-04 21:12 by bmispelon, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 17470 open python-dev, 2019-12-04 21:13
Messages (3)
msg357831 - (view) Author: Baptiste Mispelon (bmispelon) * Date: 2019-12-04 21:12
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.
msg357951 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-12-06 22:53
¶ 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.
msg358145 - (view) Author: Baptiste Mispelon (bmispelon) * Date: 2019-12-09 21:41
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?
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83156
2019-12-09 21:41:44bmispelonsetmessages: + msg358145
2019-12-07 01:38:10ned.deilysetnosy: + mdk
2019-12-06 22:53:17terry.reedysetnosy: + serhiy.storchaka, terry.reedy
messages: + msg357951
2019-12-04 21:13:16python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request16949
2019-12-04 21:12:31bmispeloncreate