Skip to content
Snippets Groups Projects
Commit 6b5235ac authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

(docs) Add instructions for the virtualenv

parent 98c6d785
No related branches found
No related tags found
No related merge requests found
......@@ -40,17 +40,22 @@ However, if you want to preview your changes on your machine---and we recommend
## Dependencies - MkDocs + Material
You can install `MkDocs`, the `Material` theme, and all the plugins with [pip](https://pip.pypa.io/en/stable/installing/):
In order to build the documentation and visualize the ouput on your machine, you have to install MkDocs and the needed packages.
The easiest way to do that is using the script we provide to create a standalone, encapsulated Python *virtualenv* directly in the documentation folder.
First of all, you need Python3 installed on your machine (you should have it already if your OS is enough recent). Then, navigate to the `documentation` folder and source the script:
```bash
cd GeoModel/documentation
source create_activate_virtualenv_p3.sh
```
pip3 install mkdocs-material # it will install `mkdocs` as well
pip3 install markdown-include
```
The script will create a Python3 virtual environment, it will activate it, it will install MkDocs and all the needed packages, and it will start the virtual env. *[If you want to install everything by hand ---* **not reccommended!** *---, please look into the script which packages you would need to install]*
## Build and serve
From the `documentation` folder, you can run
From the `documentation` folder, you can now run
```
mkdocs serve
......@@ -72,6 +77,19 @@ http://127.0.0.1:8000
You will be able to preview the documentation web site, and that will be automatically rebuilt and reloaded in the browser as soon as you change a documentation file.
To stop the local test server, just push `Ctrl+c` in the shell where the server is running. This will stop the test server.
## Closing the *virtualenv*
When you are done with editing and testing the documentation site, you can close the Python3 *virtualenv* by running in the shell:
```bash
deactivate
```
That will close the virtual environment and it will return to the standard Python interpreter and packages, the ones installed on your machine besides your main Python installation.
## Adding items to the Navigation Menu
The navigation menu configuration is stored in the `nav` section of the `documentation/mkdocs.yml` configuration file. If you want to add pages that should be directly accessible from the main navigation menu, you have to add them in that file. A detailed example follows here below.
......@@ -99,4 +117,8 @@ nav:
Please notice that in the `mkdocs.yml` configuration file all paths are relative to the `documentation/docs` folder, which is the main container folder of all the documentation content.
You can find more information on the configuration file and on the navigation menu in the [official MkDocs documentation](https://www.mkdocs.org/user-guide/writing-your-docs/).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment