Documentation
Pydantic 使用 MkDocs 进行文档编写,同时结合使用 mkdocstrings。因此,您可以利用 Pydantic 的 Sphinx 对象清单来交叉引用 Pydantic API 文档。
在您的 Sphinx 配置中,
将以下内容添加到 intersphinx 扩展配置中:
intersphinx_mapping = {
'pydantic': ('https://docs.pydantic.dev/latest', None), # (1)!
}
- 您也可以使用
dev代替latest来定位最新的文档构建,与main分支保持同步。
在您的 MkDocs 配置中,将以下 导入添加到您的 mkdocstrings 插件配置中:
plugins:
- mkdocstrings:
handlers:
python:
import:
- https://docs.pydantic.dev/latest/objects.inv # (1)!
- 您也可以使用
dev代替latest来定位最新的文档构建,与main分支保持同步。