使用Sphinx编写文档

栏目: 后端 · 发布时间: 8年前

内容简介:操作系统 : Windows7_x64Python 版本 : 2.7.10Sphinx 版本 :

操作系统 : Windows7_x64

Python 版本 : 2.7.10

Sphinx 版本 :

官方网址: http://sphinx-doc.org

github地址: https://github.com/sphinx-doc/sphinx

安装Sphinx

使用pip安装:

pip install -U Sphinx
pip install sphinx_rtd_theme

从源码安装:

git clone https://github.com/sphinx-doc/sphinx
cd sphinx
pip install .

使用Sphinx

创建项目

在控制台输入以下命令:

sphinx-quickstart

根据实际情况填写。

编写项目

index.rst示例代码:

.. _tutorial-index:

.. highlight:: python
    :linenothreshold: 0

sphinx示例文档
=============
: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

欢迎补充


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

BSD Hacks

BSD Hacks

Dru Lavigne / O'Reilly Media, Inc. / 2004-05-24 / USD 24.95

If you want more than your average BSD user--you want to explore and experiment, unearth shortcuts, create useful tools, and come up with fun things to try on your own--BSD Hacks is a must-have. This ......一起来看看 《BSD Hacks》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具