Skip to content

Commit a0947e6

Browse files
ezio-melottihugovk
andauthored
Document custom CPython roles. (#1092)
* Document custom CPython roles. * Fix role name. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> * Fix whitespace. --------- Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
1 parent 55a1cf1 commit a0947e6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

documentation/markup.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ external links ```Link text <https://example.com>`_`` :ref:`hyperl
3030
roles w/ custom text ``:role:`custom text <target>``` :ref:`roles`
3131
roles w/ only last part ``:role:`~hidden.hidden.visible``` :ref:`roles`
3232
roles w/o link ``:role:`!target``` :ref:`roles`
33+
issues ``:gh:`ID```, ``:issue:`ID``` :ref:`roles`
34+
CPython source ``:source:`PATH``` :ref:`roles`
3335
comments ``.. a comment`` :ref:`comments`
3436
======================= =========================================== ====================
3537

@@ -682,6 +684,12 @@ where simpler markup should be used:
682684
* ``*arg*`` (rendered as *arg*) for function and method arguments.
683685
* ````True````/````False````/````None```` for ``True``/``False``/``None``.
684686

687+
In addition, the CPython documentation defines a few custom roles:
688+
689+
* ``:gh:`ID```: creates a link to a GitHub issue.
690+
* ``:issue:`ID```: creates a link to a bugs.python.com issue.
691+
* ``:source:`PATH```: creates a link to a source file on GitHub.
692+
685693
There are some additional facilities that make cross-referencing roles more
686694
versatile:
687695

0 commit comments

Comments
 (0)