README.md 2 KB
Newer Older
1
2
# Generating the documentation

3
To generate the documentation, you first have to build it. Several packages are necessary to build the doc,
4
you can install them with the following command, at the root of the code repository:
5
6

```bash
7
pip install -e ".[docs]"
8
```
9

10
11
## Packages installed

12
Here's an overview of all the packages installed. If you ran the previous command installing all packages from
13
14
`requirements.txt`, you do not need to run the following commands.

15
Building it requires the package `sphinx` that you can
16
17
18
19
20
21
install using:

```bash
pip install -U sphinx
```

22
You would also need the custom installed [theme](https://github.com/readthedocs/sphinx_rtd_theme) by
23
24
25
26
27
28
[Read The Docs](https://readthedocs.org/). You can install it using the following command:

```bash
pip install sphinx_rtd_theme
```

29
30
31
32
33
34
35
36
The third necessary package is the `recommonmark` package to accept Markdown as well as Restructured text:

```bash
pip install recommonmark
```

## Building the documentation

37
Make sure that there is a symlink from the `example` file (in /examples) inside the source folder. Run the following
38
39
40
command to generate it:

```bash
Julien Chaumond's avatar
Julien Chaumond committed
41
ln -s ../../examples/README.md examples.md
42
43
```

44
45
46
47
48
49
Once you have setup `sphinx`, you can build the documentation by running the following command in the `/docs` folder:

```bash
make html
```

50
51
A folder called ``_build/html`` should have been created. You can now open the file ``_build/html/index.html`` in your browser. 

52
53
54
---
**NOTE**

Dima Veselov's avatar
Dima Veselov committed
55
If you are adding/removing elements from the toc-tree or from any structural item, it is recommended to clean the build
56
57
58
59
60
61
62
63
64
65
66
67
directory before rebuilding. Run the following command to clean and build:

```bash
make clean && make html
```

---

It should build the static app that will be available under `/docs/_build/html`

## Adding a new element to the tree (toc-tree)

LysandreJik's avatar
LysandreJik committed
68
Accepted files are reStructuredText (.rst) and Markdown (.md). Create a file with its extension and put it
thomwolf's avatar
thomwolf committed
69
in the source directory. You can then link it to the toc-tree by putting the filename without the extension.