Read the Docs index.rst目录

Getting Started

Getting Started
[译]Read the Docs 入门

index.rst

运行sphinx-quickstart以后,你将会得到一个index.rst,这相当于整个文档的目录。
现在,它因该是这样的:

.. Project documentation master file, created by
   sphinx-quickstart on Sat May  5 18:00:00 2018.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to Project's documentation!
===================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
  1. 新建.rst文件(如果你安装了recommonmark并且在conf.py中配置了Markdown,也可以是.md文件)用于放置源。在第一行写入标题,第二行多个=
  2. index.rst:caption: Contents:后面几行加入其相对路径(注意缩进,原文件是三个空格)。
    比如:(source.rst对应docs/source.rstsource/markdown.md对应docs/source/markdown.md
.. toctree::
   :maxdepth: 2
   :caption: Contents:

   source.rst
   source/markdown.md

然后make html,可以看见目录中多出来了两篇文档。分别对应源文件第一行的标题。

接着,还可以增加并修改Part的名称:

.. toctree::
   :maxdepth: 2
   :caption: Part 1:
   1.rst

.. toctree::
   :maxdepth: 2
   :caption: Part 2:
   2.rst

make html以后,可以看见目录文章标题前多出了Part 1Part 2的标记。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值