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

 

posted @ 2022-01-18 10:29  fyxs  阅读(3854)  评论(0编辑  收藏  举报