项目接口

class sphinx.project.Project(srcdir: str | os.PathLike[str], source_suffix: Iterable[str])[源代码]

项目是 Sphinx 文档的源代码集。

discover(exclude_paths: Iterable[str] = (), include_paths: Iterable[str] = ('**',)) set[str][源代码]

在源目录中查找所有文档文件,并将它们放入 docnames

doc2path(docname: str, absolute: bool) _StrPath[源代码]

返回文件名的文件名。

如果 absolute 为 True,则返回绝对路径。否则,返回相对于源目录的路径。

path2doc(filename: str | PathLike[str]) str | None[源代码]

如果该文件是文档,则返回文件名的文档名。

filename 应该是绝对的或相对于源目录的。

restore(other: Project) None[源代码]

接管上次生成的结果。

docnames: set[str]

属于该项目的文档名称。

source_suffix

source_suffix。同 source_suffix

srcdir

源目录