To reference to 'link' label, I guess you can replace in my sample:

    signode += addnodes.desc_name(sig, sig)

with:

    signode += docutils.nodes.reference('', '', internal=True,
refuri='link')

This code is not tested, I hope it will work fine ;)



On Sun, Apr 10, 2016 at 9:00 AM Andrea Cassioli <[email protected]>
wrote:

> Hi,
> thank you for the reply.
>
> What if I want to refer to a section? I mean
>
> .. _link:
>
> Section 1
> ===============
>
>
> this :ref:`link` has one layout, while this :ref2:`link` has another one
>
>
>
>
> On Saturday, April 9, 2016 at 4:29:39 PM UTC+2, Andrea Cassioli wrote:
>>
>> Hi,
>> I am struggling to find a way to do the following:
>>
>> - I would like to have a special role :myref: to link to specific
>> sections
>> - the new role should use a different layout, say show text in verbatim
>> - the new role should also have a class attribute so that it can be
>> customize using CSS
>>
>> What is a neat way to do this?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to