RendererPage
类数据类源码
RendererPage(
data: DocModule | DocFunction | DocClass | DocDataClass | DocEnum | DocTypedDict | DocProtocol | DocTypeAlias
)
用来渲染 API 页面的渲染器。
字段
| 字段 | 类型 | 必选 | |
|---|---|---|---|
data | DocModule | DocFunction | DocClass | DocDataClass | DocEnum | DocTypedDict | DocProtocol | DocTypeAlias | 用来渲染页面的数据。 |
方法
render
v_1: str = self.render()
将页面渲染成 MDX 文件。
输出
| 参数 | 类型 | |
|---|---|---|
v_1 | str | 按 MDX 格式文字所渲染的页面。 |
属性
file_path
file_path: str = self.file_path
获取用来保存页面内容的输出文件路径。
id
id: str = self.id
获取该页面的 ID。
metadata
metadata: dict[str, str] = self.metadata
包含了 Docusaurus 元数据的 YAML 文件头。
short_descr
short_descr: str = self.short_descr
页面的短描述文字。该内容提取自完整信息的第一句话。
slug
slug: str = self.slug
用作文档地址的短链接。