Sphinx is a documentation generator that translates a set of plain text source files into various output formats, automatically producing cross-references, indices, etc. Sphinx has many features for writing technical documentation which includes:
To get started with Sphinx, execute the following command:
$ sphinx-quickstart
Sphinx quickstart creates a sample project with the following standard structure:
project/
docs/
conf.py
index.rst
Makefile
For more details on Getting started with Sphinx project, Sphinx Getting Started.
To install Sphinx for contributing to documentation, the following prerequisites must be installed:
To install python, run the following command:
$ sudo apt update
$ sudo apt install python3.8
Pip is a tool for installing the python packages. To install pip in your local, run the following command:
$ sudo apt update
$ sudo apt install python3-pip
To generate the HTML documentation locally, Sphinx must be installed. Execute the following command:
$ apt-get install python3-sphinx
To build the documentation, make file must also be available on your host system.
For more details on Sphinx installation, see Sphinx Installation.
reStructuredText is a lightweight markup language that is used in static site generators like Sphinx. It contains robust tools for semantic markup, reusing content, and content filters for different kinds of outputs. It’s also easily extendible using custom directives that you can create yourself, allowing you to satisfy a wide variety of documentation needs.
For more information on Sphinx reStructuredText and its syntax usage, see reStructuredText.
Once you have your documentation written and want to turn it into HTML, it’s pretty simple. Simply run:
$ make html
The generated output HTML file can be found inside top-level docs/ build directory.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。