Skip to content

Commit

Permalink
Suppress warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 authored and yuezhao@cs.toronto.edu committed Jun 7, 2018
1 parent f9d5829 commit dfde7b6
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions docs/conf.py
Expand Up @@ -166,18 +166,21 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

# # Functional
# 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)
# Functional
from sphinx.domains.python import PythonDomain


# -- Added for surpressing warnings like below:
# WARNING: more than one target found for cross-reference '
# See https://github.com/sphinx-doc/sphinx/issues/3866
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)

0 comments on commit dfde7b6

Please sign in to comment.