Role created by custom xref types fails to insert xref link
Django docs define four custom xref types:
When creating the HTML output with sphinx-1.0 tip as of now (post 1.0.1) only the first one (the 'setting' xref type) inserts HTML links on the output.
Running the build with
nitpicky = True shows all the cross references reported as broken, with domain std.
Things tried, to no avail:
:std:prefix to the xrefs (
std:prefix to the directives (
.. templatetag:: foo->
.. std:templatetag:: foo)
- Both the above.
Finally found the cause seems to be having the directivename parameter value ("templatetag") different from the value of the rolename ("ttag") parameter in the
add_crossref_type() call. Changing the directives to
.. ttag:: foo and the API call to
app.add_crossref_type(directivename="ttag", rolename="ttag", indextemplate="pair: %s; template tag") solves the problem.
Django docs also add two custom object types and cross reference links generation fails for them too, although their parse functions are simple enough, similar to the one included for the custom 'event' object on Sphinx's
conf.py. I suspect the root cause could be the same as above.
Sphinx 0.6 doesn't show this behavior.