项目API¶
- class sphinx.project.Project(srcdir: str | os.PathLike[str], source_suffix: Iterable[str])[源代码]¶
项目是Sphinx文档的源代码集(S)。
- 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 应该是相对于源目录的绝对目录或相对目录。
- source_suffix¶
源后缀(_S)。相同于
source_suffix
。
- srcdir¶
源目录。