Disable duplicate cross-reference warnings in Sphinx.

This commit is contained in:
Todd Gamblin 2017-09-27 02:25:45 -07:00
parent 0e8bb9ec5e
commit 2198a0e229

View file

@ -135,6 +135,20 @@
# Enable todo items
todo_include_todos = True
#
# Disable duplicate cross-reference warnings.
#
from sphinx.domains.python import PythonDomain
class PatchedPythonDomain(PythonDomain):
def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
if 'refspecific' in node:
del node['refspecific']
return super(PatchedPythonDomain, self).resolve_xref(
env, fromdocname, builder, typ, target, node, contnode)
def setup(sphinx):
sphinx.override_domain(PatchedPythonDomain)
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.