Skip to content

Commit 543b361

Browse files
committed
DOC: document config value/kwarg
1 parent bd40a0d commit 543b361

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

doc/install.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,21 @@ numpydoc_xref_ignore : set
8484
numpydoc_xref_ignore = {'type', 'optional', 'default'}
8585

8686
The default is an empty set.
87+
numpydoc_xref_wrap_all : bool
88+
Whether to wrap unrecognized terms in ``param_type`` in the default
89+
``:obj:`` role. The default is ``True``.
90+
An unrecognized term is one that:
91+
1. Is in neither ``numpydoc_xref_aliases`` nor ``numpydoc_xref_ignore``.
92+
2. Is not already wrapped in a ReST role.
93+
94+
This configuration parameter may be useful if you only want create
95+
cross references for a small set of terms. In this case, including the
96+
desired cross reference mappings in ``numpydoc_xref_aliases`` and setting
97+
``numpydoc_xref_wrap_all = False`` is more convenient than adding all of
98+
the non-linked terms to the ``numpydoc_xref_ignore`` set.
99+
100+
If ``numpydoc_xref_param_type`` is set to ``False``, this config parameter
101+
has no effect.
87102
numpydoc_edit_link : bool
88103
.. deprecated:: edit your HTML template instead
89104

numpydoc/xref.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ def make_xref(param_type, xref_aliases, xref_ignore, wrap_unknown=True):
108108
to fully qualified names that can be cross-referenced.
109109
xref_ignore : set
110110
Words not to cross-reference.
111+
wrap_unknown : bool, default=True
112+
Toggle whether to wrap unrecognized terms in the default :obj: role,
113+
default is `True`. Unrecognized terms include those that are in
114+
neither `xref_aliases` nor `xref_ignore` and are not already wrapped
115+
in an rST role.
111116
112117
Returns
113118
-------

0 commit comments

Comments
 (0)