How to make an internal hyperlink in Sphinx documentation? I am using:
:role:`target`
But it is not working.
The toctree directive is the central element. Note. Simple “inclusion” of one file in another can be done with the include directive. Note. To create table of contents for current document (.
To support Markdown-based documentation, Sphinx can use MyST-Parser. MyST-Parser is a Docutils bridge to markdown-it-py, a Python package for parsing the CommonMark Markdown flavor.
Cross-referencing is done using a ref
:ref:`label-name`
You can provide your labels using:
.. _label-name:
See: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref
Roles are used to create custom interpreted text. See: http://docutils.sourceforge.net/docs/ref/rst/directives.html#role
In somewhere the heading is,
.. _HeaderTag: Header ------
Ref to above header (may not the same file)
:ref:`HeaderTag` # or with custom text :ref:`custom header<HeaderTag>`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With