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