1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
Pydantic uses [MkDocs](https://www.mkdocs.org/) for documentation, together with
[mkdocstrings](https://mkdocstrings.github.io/). As such, you can make use of Pydantic's
Sphinx object inventory to cross-reference the Pydantic API documentation.
=== "Sphinx"
In your [Sphinx configuration](https://www.sphinx-doc.org/en/master/usage/configuration.html),
add the following to the [`intersphinx` extension configuration](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration):
```python {test="skip"}
intersphinx_mapping = {
'pydantic': ('https://docs.pydantic.dev/latest', None), # (1)!
}
```
1. You can also use `dev` instead of `latest` to target the latest documentation build, up to date
with the [`main`](https://github.com/pydantic/pydantic/tree/main) branch.
=== "mkdocstrings"
In your [MkDocs configuration](https://www.mkdocs.org/user-guide/configuration/), add the following
import to your [mkdocstrings plugin configuration](https://mkdocstrings.github.io/usage/#cross-references-to-other-projects-inventories):
```yaml
plugins:
- mkdocstrings:
handlers:
python:
import:
- https://docs.pydantic.dev/latest/objects.inv # (1)!
```
1. You can also use `dev` instead of `latest` to target the latest documentation build, up to date
with the [`main`](https://github.com/pydantic/pydantic/tree/main) branch.
|