Skip to content

Commit

Permalink
Disable cross-ref links for type annotations (#1374)
Browse files Browse the repository at this point in the history
  • Loading branch information
trsvchn committed Oct 7, 2020
1 parent cb5b4e6 commit 391c13a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,16 @@

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# -- Type hints configs ------------------------------------------------------

autodoc_typehints = "signature"

# -- A patch that turns-off cross refs for type annotations ------------------

import sphinx.domains.python
from docutils import nodes
from sphinx import addnodes

# replaces pending_xref node with desc_type for type annotations
sphinx.domains.python.type_to_xref = lambda t, e=None: addnodes.desc_type("", nodes.Text(t))

0 comments on commit 391c13a

Please sign in to comment.