Hi, I think you can use add_object_type API to add custom roles (and directives). http://www.sphinx-doc.org/en/stable/extdev/appapi.html#sphinx.application.Sphinx.add_object_type
This is a sample code that is using the API. https://gist.github.com/shimizukawa/4498647 I know this sample doesn't achieve your purpose, but it is usable to understand the API. Best regards, -- Takayuki SHIMIZUKAWA http://about.me/shimizukawa On Sat, Apr 9, 2016 at 11:29 PM Andrea Cassioli <[email protected]> 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.
