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.

Author dom1310df
Recipients docs@python, dom1310df, taleinat
Date 2021-05-09.18:05:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620583519.23.0.917808073566.issue44084@roundup.psfhosted.org>
In-reply-to
Content
I'm not sure this is a Pygments or Sphinx bug. The documentation for the :keyword: role[1] says:

   This creates a link to a reference label with that name, if it exists.


Looking at the documentation source for "Compound statements"[2] each section for a particular keyword is preceded by a reference label for the relevant keyword(s).

So for "match" and "case" all that's needed is to put the label before the section of the docs talking about them.
In fact, it seems that "match" does have a label[3], and I can link to it successfully; it's just "case" and "_" that don't work

"_" is more tricky, as you can't have a reference label called that. However, if you pick another name for the label (say, "underscore") you can use that as the target name and still have "_" as the text like so:

    :keyword:`_ <underscore>`


[1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-keyword
[2] https://raw.githubusercontent.com/python/cpython/main/Doc/reference/compound_stmts.rst
[3] https://github.com/python/cpython/blame/main/Doc/reference/compound_stmts.rst#L514
History
Date User Action Args
2021-05-09 18:05:19dom1310dfsetrecipients: + dom1310df, taleinat, docs@python
2021-05-09 18:05:19dom1310dfsetmessageid: <1620583519.23.0.917808073566.issue44084@roundup.psfhosted.org>
2021-05-09 18:05:19dom1310dflinkissue44084 messages
2021-05-09 18:05:19dom1310dfcreate