Is it possible to add an anchor (link target, to which I can refer with :ref:
) at an arbitrary position in the text? I have a situation like this:
Some text
.. class:: mylist
**Term 1**
Definition
*Term 2*
Definition
:customrole:`Term 3` extra
Definition
And I'd like to add a link to, say Term 2
. I cannot simply add .. _target:
before the block, because that breaks the list in two, and the second part does not get the mylist
class (is this intentional or could it be a bug?). I could write this:
*Term 2*
.. _target:
Definition
but then the target is the definition paragraph, not the Term 2
element itself.
Applying an inline role to Term 2
is not simple either, because then there's the problem of nested formatting (I've used different styles for each terms to show that there could be a variety of situations I'd need this for). Maybe if I could apply an inline role to some empty text...
Any suggestion?