Sphinx提供了自定义指令toctree来支持实现这个功能。 .. toctree:: 这个指令会在当前位置插入文档的目录树。关联文档的路径可以使用相对路径或者绝对路径。 章节序号 如果你需要给章节添加序号,可以给最顶层的toctree添加numbered参数。 .. toctree:: :titlesonly: foo bar 还可以使用unix通配符,通过glob参数指定: .. toctree:: :glob: intro 如果你只想使用最顶层的toctree,而忽略掉其它的toctree指令,可以使用includehidden。 .. toctree:: :includehidden: doc_1 doc_2 最后要注意的是,所有源目录中的文档必须出现在toctree指令中,否则sphinx会告警。
robomaster.jpg ================================== 欢迎来到 RoboMaster 开发者页面 ================================== .. toctree caption: 快速开始 :numbered: introduction.rst code_env_setup.rst third_part_comm.rst .. toctree multi_robot_apis.rst python_sdk/multi_robot_drone_example.rst python_sdk/multi_robot_ep.rst .. toctree text_sdk/intro.rst text_sdk/connection.rst text_sdk/apis.rst text_sdk/multi_ctrl.rst .. toctree caption: Python 编程说明 :numbered: python/intro.rst python/feature.rst python/apis.rst .. toctree
分析页面 html 结构 分析可知,所有例子链接都在
You can adapt this file completely to your liking, but it should at least contain the root `toctree ====================================== .. toctree:: :maxdepth: 2 :caption: Contents: Indices +空格+后面的文本,代表注释(网页上不显示) 等号线====+上一行的文本,代表一级标题 .. toctree::声明的一个树状结构(Table of Content Tree) :maxdepth: 行是索引和搜索链接(可以先不用管) 3.2.2 修改index文件 修改soure文件夹下的index.rst文件,,这里表示添加了一个Cpp目录,然后Cpp目录下,链接的又一个index文件 .. toctree soure/Cpp/01设计模式中的index.rst文件内容如下,这里表示管理了2个文档 设计模式 ================================= .. toctree::
index.rst中包含了目录树指令toctree,sphinx使用它链接其他子文档。 toctree指令的初始值为空: .. toctree:: :maxdepth: 2 接下来就可以给它添加子文档的链接了,直接使用文档的名称即可,省略掉文件后缀,如果是多级目录,则使用/分隔开。 .. toctree:: :maxdepth: 2 intro tutorial chapter/doc1 ...
conf.py: Sphinx的配置文件 index.rst: 主文档定义文档结构 主文档index.rst的主要功能是被转换成欢迎页, 它包含一个目录表( “table of contents tree”或者 toctree Sphinx 主要功能是使用 reStructuredText, 把许多文件组织成一份结构合理的文档. toctree指令初始值如下: .. toctree:: :maxdepth: 2 你可以在 content 的位置添加文档列表: .. toctree:: :maxdepth: 2 tutorial.md ...
You can adapt this file completely to your liking, but it should at least contain the root `toctree ================================== .. toctree:: :maxdepth: 2 :caption: Contents: Indices and
├─_static └─_templates 增加了两个文件夹,文件夹下面各自有各自的 rst 文件 修改 index.rst 文件 Learn ---------------------- .. toctree :caption: Learn 20170916 Learn/markdown Learn/rest Practice ---------------------- .. toctree /html/index.html 文件 结果如下: 12.png 总结: sphinx-quickstart 初始化文档项目 根据需求创建文件夹和文件 修改 index.rst 对文档结构进行组织 toctree
04.定位目录及网址 从图看到我们需要的目录包含在
之间,标签里为一级目录及网址;标签里为二级目录及网址。 menu = soup.find_all('div', class_='section') chapters = menu[0].div.ul.find_all('li', class_='toctree-l1req=urllib2.urlopen(r'https://docs.python.org/2/library/index.html') p=re.compile(r'''<li class="<em>toctree</em>
/TocTree.vue" 引入后对组件进行注册: components:{ TreeToc } 方法二,使用 uniapp 的 easycom 。
可以看到这个内容的地址和内容标题都在这个a标签上,所以正则很容易,如下: toctree-l1.*?reference internal" href="([^"]*?)">(.*?) response.status_code == 200: response.encoding = 'utf-8' hrefs = re.findall('toctree-l1
我禁止调度器,不运行任务切换 .. toctree:: :maxdepth: 2 section1 12.1 屏蔽中断 屏蔽中断有两套宏:任务中使用、ISR中使用: 任务中使用:taskENTER_CRITICA
index.rst文件,添加新增的hello.rst文件 hello.rst文件内容如下: hello, python ============== index.rst文件修改如下: Contents: .. toctree
======================================= .. toctree:: :caption: Basic concepts :hidden: api
.. toctree:: :maxdepth: 2 :caption: Contents: how_to_be_a_rich_man 然后删除这几行 Indices and tables
ls conf.py index.rst myshell-note.md myshell-note.rst _static _templates 编辑index.rst,进行引用文件 .. toctree
www.apelearn.com/study_v2/" s = requests.session() text = s.get(url).text reg = re.compile(r'<li class=\"toctree-l1
本章涉及如下内容: FreeRTOS的哪些API函数能在ISR中使用 怎么把中断的处理分为两部分:ISR、任务 ISR和任务之间的通信 .. toctree:: :maxdepth
这样我们可以把module.rst修改成这样的形式: module1 ======= .. toctree:: :maxdepth: 4 module1 module2 ======= .. toctree:: :maxdepth: 4 module2 这里rst文档会自动搜寻同目录下的module1.rst和module2.rst文件,并自动化的生成文档。