使用Sphinx編寫文檔

來源:互聯網
上載者:User

標籤: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編寫文檔

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.