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`
- 建立
檔案(如果你安裝了.rst
并且在recommonmark
中配置了Markdown,也可以是conf.py
檔案)用于放置源。在第一行寫入标題,第二行多個.md
。=
- 在
中index.rst
:caption: Contents:
後面幾行加入其相對路徑(注意縮進,原檔案是三個空格)。
比如:(
對應source.rst
,docs/source.rst
對應source/markdown.md
)docs/source/markdown.md
.. toctree::
:maxdepth:
:caption: Contents:
source.rst
source/markdown.md
然後
make html
,可以看見目錄中多出來了兩篇文檔。分别對應源檔案第一行的标題。
接着,還可以增加并修改Part的名稱:
.. toctree::
:maxdepth:
:caption: Part :
.rst
.. toctree::
:maxdepth:
:caption: Part :
.rst
make html
以後,可以看見目錄文章标題前多出了
Part 1
、
Part 2
的标記。