generate_documentation.rst.txt
2.51 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
********************************************
Generate this documentation
********************************************
This documentation is generated by the use of Sphinx and Pyreverse.
Sphinx uses the `Restructured Text format <https://en.wikipedia.org/wiki/ReStructuredText>`_.
The following links gives some informations about the syntax:
* `Tutorial Sphinx 1 <https://deusyss.developpez.com/tutoriels/Python/SphinxDoc/>`_.
* `Tutorial Sphinx 2 <https://www.mankier.com/1/sphinx-all>`_.
* `Tutorial documentation <https://www.codeflow.site/fr/article/documenting-python-code>`_.
* `Tutorial reST <https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html>`_.
* `Tutorial Napoleon extension <https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#module-sphinx.ext.napoleon>`_.
Installation of Sphinx and Pyreverse
***********************************************
Procedure for Linux (root privileges):
.. code-block:: bash
sudo pip3 install sphinx
sudo pip3 install rst2pdf
sudo pip3 install pylint
sudo pip3 install sphinx_pyreverse
sudo pip3 install graphviz
sudo apt-get install graphviz graphviz-dev
sudo pip3 install pygraphviz
Procedure for Windows (user xxx). First you must download and install
`Graphviz <https://graphviz.org/>`_. Then:
.. code-block:: bash
cd c:\Users\xxx\Anaconda3\Scripts
.\pip install -U Sphinx
.\pip install rst2pdf
.\conda install pyreverse
.\conda install python-graphviz
Generate the documentation
***********************************************
To generate the documentation you must start to execute pyreverse
followed by sphinx.
Procedure pyreverse for Linux:
.. code-block:: bash
cd /home/pi/astromecca/doc_rst/doc_pyreverse
pyreverse3 -p mount -o png --ignore=celme ../../mountastro
pyreverse3 -p celme -o png --ignore=mountastro ../../celme
cp classes_*.png ../doc_images
Procedure sphinx for Linux:
.. code-block:: bash
cd /home/pi/astromecca/doc_rst
sphinx-build -b html . ./../doc_html
sphinx-build -b pdf . ./../doc_pdf
Procedure pyreverse for Windows (user xxx):
.. code-block:: bash
cd astromecca\doc_rst\doc_pyreverse
c:\Users\xxx\Anaconda3\Scripts\pyreverse -p mount -o png --ignore=celme ../../mountastro
c:\Users\xxx\Anaconda3\Scripts\pyreverse -p celme -o png --ignore=mountastro ../../celme
copy classes_*.png ..\doc_images
Procedure sphinx for Windows (user xxx):
.. code-block:: bash
cd astromecca\doc_rst
C:\Users\xxx\Anaconda3\Scripts\sphinx-build -b html . .\..\doc_html
C:\Users\xxx\Anaconda3\Scripts\sphinx-build -b pdf . .\..\doc_pdf