doctree

Create doc tree if you follows

Sanhe Sphinx standard.

class docfly.doctree.ArticleFolder(index_file=None, dir_path=None)[source]

Represent an index.rst or index.ipynb file with a Title in a directory.

Parameters
  • index_file – the index file name (no file extension)

  • dir_path – A folder contains single rst file. The rst file path

中文文档

一篇 Article 代表着文件夹中有一个 index.rstindex.ipynb 文件的文件夹. 其中必然有至少一个标题元素.

property rst_path

The actual rst file absolute path.

property ipynb_path

The actual ipynb file absolute path.

property rel_path

File relative path from the folder.

property title

Title for the first header.

get_title_from_rst()[source]

Get title line from .rst file.

中文文档

从一个 _filename 所指定的 .rst 文件中, 找到顶级标题. 也就是第一个 ====----~~~~ 上面一行.

get_title_from_ipynb()[source]

Get title line from .ipynb file.

中文文档

从一个 _filename 所指定的 .ipynb 文件中, 找到顶级标题. 也就是第一个 # 后面的部分.

有的时候我们会用 raw RestructuredText 来做顶级标题.

property sub_article_folders

Returns all valid ArticleFolder sitting inside of ArticleFolder.dir_path.

toc_directive(maxdepth=1)[source]

Generate toctree directive text.

Parameters
  • table_of_content_header

  • header_bar_char

  • header_line_length

  • maxdepth

Returns