Blame view

docs/source/generate_documentation.rst 2.29 KB
96482ab2   Alain Klotz   first commit
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
********************************************
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>`_.
	* `Pandoc to convert many formats into reST <https://pandoc.org/>`_.

Installation of Sphinx and Pyreverse
***********************************************

For Linux users
===============

.. code-block:: bash

	sudo apt-get install graphviz graphviz-dev
	cd ~/Documents/guitastro/install
	python3 -m pip install -r requirements.txt
	python3 -m pip install -r requirements_dev.txt

For Windows users
=================

First you must download and install `Graphviz <https://graphviz.org/>`_.

Open a Powershell as administrator. 
A quick way to open Powershell as administrator is 
Win+R (execute commands) and put: 

.. code-block:: bash

	powershell Start-Process powershell -Verb runAs
	
Then, in the Powershell terminal:

.. code-block:: bash

	cd C:\Users\xxx\Documents\guitastro\install
	python -m pip install -r requirements.txt
	python -m pip install -r requirements_dev.txt

Generate the documentation
***********************************************

To generate the documentation you must use the doc_rst batch. It starts to execute pyreverse 
and then sphinx. 

Procedure for Linux. Open a terminal:

.. code-block:: bash

	cd ~/Documents/guitastro/docs
	sh make_doc

make_doc will generate UML diagrams from the Python code, the html and the PDF documentations.
To generate only html and pdf documentation, you can use:

.. code-block:: bash

	cd ~/Documents/guitastro/docs
	make html

Procedure for Windows. Open a PowerShell as administrator:

.. code-block:: bash

	cd C:\Users\xxx\Documents\guitastro\docs
	.\make_doc