I specify an explicit link target as follows:
.. _REPLY_STATUS_CODE:
REPLY_STATUS_CODE (0x0001)
---------------------------
Then create a reference to it like this:
Related
:ref:`REPLY_STATUS_CODE`
And have also tried like this:
A :ref:`REPLY_STATUS_CODE <REPLY_STATUS_CODE>` command...
In both cases the text on the link is "Section 3.8" rather than "REPLY_STATUS_CODE" using Sphinx to build HTML renders the link text as "REPLY_STATUS_CODE". Is there a way to get the text I want rather than section and a number in rinohtype?
You can make rinohtype create links identical to those in HTML by adjusting the linked reference style:
[STYLESHEET]
name = My custom style sheet
base = sphinx
[linked reference]
type = custom
You can still use the :numref:
role to explicitly reference elements by number (which does require setting numfig = True
, also affecting HTML output). See issue #244 How to restore target number references? for more information.
Ideally, providing an explicit link text like you tried (:ref:`REPLY_STATUS_CODE <REPLY_STATUS_CODE>`
) would override the default behavior of linking sections by number, but this would require changes to docutils/Sphinx because rinohtype cannot see the difference between a reference with and without explicit link text.
Finally, it would be great to be able to define a custom role so that rinohtype could distinguish between different types of references. For example:
.. role:: titleref(ref)
:class: titleref
Alas, that isn't possible either. So, for now at least, you can only distinguish using :ref:
and :numref:
(which also affects HTML output).