標籤:blog user 分段 res git clone date nbsp htm 情況
作業系統 : Windows7_x64
Python 版本 : 2.7.10
Sphinx 版本 :
官方網址:http://sphinx-doc.org
github地址: https://github.com/sphinx-doc/sphinx
安裝Sphinx
使用pip安裝:
pip install -U Sphinxpip install sphinx_rtd_theme
從源碼安裝:
git clone https://github.com/sphinx-doc/sphinxcd sphinxpip install .
使用Sphinx
建立項目
在控制台輸入以下命令:
sphinx-quickstart
根據實際情況填寫。
編寫項目
index.rst範例程式碼:
.. _tutorial-index:.. highlight:: python :linenothreshold: 0sphinx範例文件=============:Release: |version|:Date: |today|歡迎閱讀sphinx範例文件=============================================內容樣本:.. toctree:: :maxdepth: 2 test1.rst
index.rst 為主檔案
test1.rst 為具體內容
test1.rst樣本內容:
rst文法簡介===========空行分段----------第一段內容。第二段和第一段間有空行。
編譯項目
產生html文檔
sphinx-build -b html source/ build/
本文github地址:
https://github.com/mike-zhang/mikeBlogEssays/blob/master/2018/20181006_使用Sphinx編寫文檔.rst
歡迎補充
使用Sphinx編寫文檔