Skip to content

Commit

Permalink
remove fix for now-closed sphinx issue 8127 (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebachmeier committed Aug 28, 2024
1 parent adc675c commit ff193ad
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
from pathlib import Path

from docutils.nodes import Text
from sphinx.ext.intersphinx import missing_reference

import vivarium

base_dir = Path(vivarium.__file__).parent
Expand Down Expand Up @@ -235,22 +232,3 @@
dtype, target = line.split(None, 1)
target = target.strip()
nitpick_ignore.append((dtype, target))


# Fix sphinx warnings when for literal Ellipses in type hints.
def setup(app):
app.connect("missing-reference", __sphinx_issue_8127)


def __sphinx_issue_8127(app, env, node, contnode):
reftarget = node.get("reftarget", None)
if reftarget == "..":
node["reftype"] = "data"
node["reftarget"] = "Ellipsis"
text_node = next(iter(contnode.traverse(lambda n: n.tagname == "#text")))
replacement_node = Text("...", "")
if text_node.parent is not None:
text_node.parent.replace(text_node, replacement_node)
else: # e.g. happens in rtype fields
contnode = replacement_node
return missing_reference(app, env, node, contnode)

0 comments on commit ff193ad

Please # to comment.