Sphinx extension generates warnings since Sphinx 1.4
Since I upgraded Sphinx to 1.4, I get the following warnings:
WARNING: while setting up extension zot4rst.sphinx: directive 'zotero-setup' is already registered, it will be overridden WARNING: while setting up extension zot4rst.sphinx: directive 'bibliography' is already registered, it will be overridden WARNING: while setting up extension zot4rst.sphinx: role 'smallcaps' is already registered, it will be overridden
This seems to come from the fact that those roles and directives are indeed registered twice:
- once using docutils'
- once using sphinx's
add_directive(in the extension
As I understand, zot4rst is meant to be used also outside of Sphinx, so I tried commenting out the Sphinx-specific registration, and left the docutils registration. This works, which is not surprising: for the moment, the only thing that
add_directive is to call the respective docutil registration function (besides checking for existing registration and displaying the warnings above...).
However, I think my solution is a dirty workaround: it is possible that future versions of Sphinx do more things in
add_X, so not calling them may cause bugs. I think it would be wiser to move the calls to docutils'
register_X in a separate module, which would have to be imported explicitly by non-Sphinx applications relying solely on