From 2198a0e2295e7ac4969a220580cceecfbb47af11 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 27 Sep 2017 02:25:45 -0700 Subject: [PATCH] Disable duplicate cross-reference warnings in Sphinx. --- lib/spack/docs/conf.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py index 887d04b565..b27a3a5538 100644 --- a/lib/spack/docs/conf.py +++ b/lib/spack/docs/conf.py @@ -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.