I'd like my default cross reference type (:ref:`foo`) to use nodes.literal 
instead of nodes.emphasis. (I have no need for <em> tags around my internal 
link contents in HTML output when there is already a class="reference 
internal" that i can use to style them, and styling a.reference.internal em 
seems to irritate IE6 which does not accept multiple classes in CSS)

AFAICT, this nodes.emphasis default is set in 
sphinx.domains.std.StandardDomain, 
where StandardDomain.roles['ref]=XRefRole(lowercase=True, 
innernodeclass=nodes.emphasis, warn_dangling=True),

I can't find any settings which will change this, and in fact, even awful 
hacks to change it don't seem to work - I tried putting this into a custom 
extension

    from sphinx.domains.std import StandardDomain
    from sphinx.roles import XRefRole
    
    StandardDomain.roles ['ref'] = XRefRole(
        lowercase=True, innernodeclass=nodes.literal,
        warn_dangling=True)

but i still ended up with <em> around my hyperlinks.

What is the accepted way to change this behaviour? Is it to redefine the 
'ref' XRef type? or to create a new one using App.add_object_type? Or 
something else?

TIA
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/XQT5NVPxHGEJ.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to