mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Previously, there were two type preprocessing functions: `_convert_type_spec` (used in Google-style docstrings) and `_convert_numpy_type_spec` (used in Numpy-style docstrings). The Google version simply applied type-alias translations or wrapped the text in a `:py:class:` role. The Numpy version does the same, plus adds special handling for keywords `optional` and `default` and delimiter words `or`, `of`, and `and`. This allows one to write in natural language, like `Array of int` instead of `Array[int]` or `Widget, optional` instead of `Optional[Widget]` or `Widget | None`. Numpy style is described in full at: https://numpydoc.readthedocs.io/en/latest/format.html#parameters This commit eliminates the distinction and allows Google-style docstrings to use these preprocessing rules. |
||
---|---|---|
.. | ||
certs | ||
js | ||
roots | ||
test_builders | ||
test_config | ||
test_directives | ||
test_domains | ||
test_environment | ||
test_extensions | ||
test_intl | ||
test_markup | ||
test_pycode | ||
test_theming | ||
test_transforms | ||
test_util | ||
test_writers | ||
__init__.py | ||
conftest.py | ||
test_addnodes.py | ||
test_application.py | ||
test_command_line.py | ||
test_errors.py | ||
test_events.py | ||
test_highlighting.py | ||
test_project.py | ||
test_quickstart.py | ||
test_roles.py | ||
test_search.py | ||
test_versioning.py | ||
utils.py |