2019-07-06 05:11:13 +08:00
|
|
|
# Generating the documentation
|
|
|
|
|
2019-07-09 22:11:29 +08:00
|
|
|
To generate the documentation, you first have to build it. Several packages are necessary to build the doc,
|
|
|
|
you can install them using:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pip install -r requirements.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
## Packages installed
|
|
|
|
|
|
|
|
Here's an overview of all the packages installed. If you ran the previous command installing all packages from
|
|
|
|
`requirements.txt`, you do not need to run the following commands.
|
|
|
|
|
|
|
|
Building it requires the package `sphinx` that you can
|
2019-07-06 05:11:13 +08:00
|
|
|
install using:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pip install -U sphinx
|
|
|
|
```
|
|
|
|
|
|
|
|
You would also need the custom installed [theme](https://github.com/readthedocs/sphinx_rtd_theme) by
|
|
|
|
[Read The Docs](https://readthedocs.org/). You can install it using the following command:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pip install sphinx_rtd_theme
|
|
|
|
```
|
|
|
|
|
2019-07-09 22:11:29 +08:00
|
|
|
The third necessary package is the `recommonmark` package to accept Markdown as well as Restructured text:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pip install recommonmark
|
|
|
|
```
|
|
|
|
|
|
|
|
## Building the documentation
|
|
|
|
|
2019-09-27 06:19:51 +08:00
|
|
|
Make sure that there is a symlink from the `example` file (in /examples) inside the source folder. Run the following
|
2019-09-07 00:13:31 +08:00
|
|
|
command to generate it:
|
|
|
|
|
|
|
|
```bash
|
2019-09-27 06:19:51 +08:00
|
|
|
ln -s ../../examples/README.md examples.md
|
2019-09-07 00:13:31 +08:00
|
|
|
```
|
|
|
|
|
2019-07-06 05:11:13 +08:00
|
|
|
Once you have setup `sphinx`, you can build the documentation by running the following command in the `/docs` folder:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
make html
|
|
|
|
```
|
|
|
|
|
2019-07-09 22:11:29 +08:00
|
|
|
---
|
|
|
|
**NOTE**
|
|
|
|
|
2019-10-02 08:21:55 +08:00
|
|
|
If you are adding/removing elements from the toc-tree or from any structural item, it is recommended to clean the build
|
2019-07-09 22:11:29 +08:00
|
|
|
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)
|
|
|
|
|
2019-07-09 22:16:09 +08:00
|
|
|
Accepted files are reStructuredText (.rst) and Markdown (.md). Create a file with its extension and put it
|
2019-07-12 17:46:57 +08:00
|
|
|
in the source directory. You can then link it to the toc-tree by putting the filename without the extension.
|