The following ReStructuredText contains the :ref:
role, which is a Sphinx-extension:
Read more in :ref:`section-target`.
.. _section-target:
Section Title
=============
Text body.
Where
:ref:`section-target`
is parsed to the following doctree:
<reference internal="True" refid="section-target"><inline classes="std std-ref">Section Title</inline></reference>
You can reproduce this by storing the above reStructuredText into sphinx_input/index.rst
and run sphinx-build -b xml -C sphinx_input sphinx_ouptut
.
Is there an equivalent that I can use to generate this exact same doctree that only uses docutils restructuredtext? (Thus no Sphinx-specific roles or directives). I don't care about readability, since this will be machine-parsed only.
So far, the closest I got was:
`Section Title <section-target>`_
which resulted in:
<reference name="Section Title" refuri="section-target">Section Title</reference>
That's close, but it defines a refuri
, not a refid
.
Regretfully, the documentation of the reference
doctree is missing.