跳到主要内容

RendererPage

类数据类源码

RendererPage(
data: DocModule | DocFunction | DocClass | DocDataClass | DocEnum | DocTypedDict | DocProtocol | DocTypeAlias
)

用来渲染 API 页面的渲染器。

字段​

字段类型必选
说明
dataDocModule | DocFunction | DocClass | DocDataClass | DocEnum | DocTypedDict | DocProtocol | DocTypeAlias用来渲染页面的数据。

方法​

render​

v_1: str = self.render()

将页面渲染成 MDX 文件。

输出​

参数类型
说明
v_1str按 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

用作文档地址的短链接。