File size: 1,213 Bytes
d596074
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Contributing to Documentation
=============================

We use `sphinx <https://www.sphinx-doc.org/en/master/>`_
for documentation.

Before writing documentation, you have to prepare the environment:

  .. code-block:: bash

    $ cd docs
    $ pip install -r requirements.txt

After setting up the environment, you are ready to write documentation.
Please refer to `reStructuredText Primer <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_
if you are not familiar with ``reStructuredText``.

After writing some documentation, you can build the documentation **locally**
to preview what it looks like if it is published:

  .. code-block:: bash

    $ cd docs
    $ make html

The generated documentation is in ``docs/build/html`` and can be viewed
with the following commands:

  .. code-block:: bash

    $ cd docs/build/html
    $ python3 -m http.server

It will print::

  Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...

Open your browser, go to `<http://0.0.0.0:8000/>`_, and you will see
the following:

    .. figure:: images/doc-contrib.png
       :width: 600
       :align: center

       View generated documentation locally with ``python3 -m http.server``.