rst文件查看(Sphinx)


  reStructuredText ( RST 、 ReST 或 reST )是一種用於文本數據的文件格式,主要用於 Python 編程語言社區的技術文檔。

  在下載了別人的Python源文件里面有rst文件時,可以轉為HTML使用瀏覽器進行查看。

以pyserial模塊的文檔在windows下為例。

  下面是pyserial模塊包:

  

  documentation中我們需要查看的rst文檔文件:

  

  ①    安裝Spinhx

pip install -U Sphinx

  ②    使用build命令將rst文件輸出為html文件

Sphinx-build -b html doc1 doc2

  Doc1 為rst文檔目錄(必須包含conf.py文件)

  Doc2 為html的輸出文件夾

  ③ 找到需要轉換的文檔目錄(documentation)

  

  使用命令:

Sphinx-build documentation doc1

  

   ④在文檔同一目錄下生成html文檔,打開index.html就可以使用瀏覽器器查看了。

  

 

 參考:https://www.sphinx-doc.org/en/master/#

   sphinx.org.cn/index.html

   https://www.cnblogs.com/xiao-apple36/p/9209338.html#_label0_0

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM