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