Skip to content

Commit 2c318f9

Browse files
author
Wouter Buytaert
committed
make documentation multilingual (English, Spanish)
1 parent 97849c2 commit 2c318f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1021
-38
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,4 @@ GitHub.sublime-settings
113113
_other/
114114
log/
115115
scratch/
116+
.DS_Store

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,4 @@ A live version of the tool can be found in:
1717

1818
Paricia is developed at [Imperial College London](https://www.imperial.ac.uk/) by the Research Software Engineering team within the Research Computing Group. The project is coordinated by [Prof. Wouter Buytaert](https://www.imperial.ac.uk/people/w.buytaert), who leads a group in the Civil Engineering Department and that focus on the impact of environmental change on the water cycle and its consequences for managing water resources. This work involves gathering and processing time-series data like water level, flow and temperature from various monitoring stations based in mountainous areas such as the Andes and Himalayas.
1919

20-
The code was originally based on the iMHEA platform - Plataforma para la **I**niciativa Regional de **M**onitoreo **H**idrológico de **E**cosistemas **A**ndinos. We are grateful to the following instututions for the development of iMHEA and for sharing their code to use as a starting point for Paricia:
21-
22-
- [Fondo para la Proteccion del Agua (FONAG)](https://www.fonag.org.ec/web/), Ecuador.
23-
- [Empresa Pública Metropolitana de Agua Potable Y Saneamiento de Quito (EPMAPS)](https://www.aguaquito.gob.ec/home/), Ecuador.
20+
The code was originally based on the SEDC platform developed by the [Fondo para la Proteccion del Agua (FONAG)](https://www.fonag.org.ec/web/) and the [Empresa Pública Metropolitana de Agua Potable Y Saneamiento de Quito (EPMAPS)](https://www.aguaquito.gob.ec/home/), Ecuador. We are grateful to these institutes for sharing their code to use as a starting point for Paricia:

mkdocs.yml config/en/mkdocs.yml

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
site_name: Paricia
1+
site_name: Paricia user manual
22
repo_url: https://github.com/ImperialCollegeLondon/paricia
33

4+
docs_dir: '../../docs/en' # Where to find the English markdown files
5+
site_dir: '../../site/en' # Where to put the English HTML files
6+
47
theme:
58
name: "material"
9+
custom_dir: '../../overrides/' # This is where the customization of the theme lives
10+
Language: en
611
features:
712
- navigation.tabs
813

@@ -20,11 +25,27 @@ markdown_extensions:
2025
emoji_index: !!python/name:material.extensions.emoji.twemoji
2126
emoji_generator: !!python/name:material.extensions.emoji.to_svg
2227

28+
extra_css:
29+
- assets/stylesheets/yesplan.css # CSS is shared by all languages
30+
31+
extra: # Language Selection
32+
alternate:
33+
# Switch to English
34+
- name: English
35+
link: /en/
36+
lang: en
37+
# Switch to Spanish
38+
- name: Español
39+
link: /es/
40+
lang: es
41+
42+
2343
plugins:
24-
- search
44+
- search:
45+
lang: en # Set language for search
2546
- gen-files:
2647
scripts:
27-
- docs/gen_ref_nav.py
48+
- ../../includes/gen_ref_nav.py
2849
- literate-nav:
2950
nav_file: SUMMARY.md
3051
- section-index
@@ -45,6 +66,7 @@ plugins:
4566
ignore_classes: ["no-caption"]
4667

4768
nav:
69+
- Home: index.md
4870
- User Guide:
4971
- Introduction: introduction.md
5072
- Reports: reports.md

config/es/mkdocs.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
site_name: Manual de Paricia
2+
repo_url: https://github.com/ImperialCollegeLondon/paricia
3+
4+
docs_dir: '../../docs/es' # Where to find the English markdown files
5+
site_dir: '../../site/es' # Where to put the English HTML files
6+
7+
theme:
8+
name: "material"
9+
custom_dir: '../../overrides/' # This is where the customization of the theme lives
10+
Language: es
11+
features:
12+
- navigation.tabs
13+
14+
markdown_extensions:
15+
- admonition
16+
- pymdownx.snippets:
17+
check_paths: true
18+
- toc:
19+
permalink: "¤"
20+
- markdown_include.include:
21+
base_path: .
22+
- attr_list
23+
- md_in_html
24+
- pymdownx.emoji:
25+
emoji_index: !!python/name:material.extensions.emoji.twemoji
26+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
27+
28+
extra_css:
29+
- assets/stylesheets/yesplan.css # CSS is shared by all languages
30+
31+
extra: # Language Selection
32+
alternate:
33+
# Switch to English
34+
- name: English
35+
link: /en/
36+
lang: en
37+
# Switch to Spanish
38+
- name: Español
39+
link: /es/
40+
lang: es
41+
42+
43+
plugins:
44+
- search:
45+
lang: es # Set language for search
46+
- gen-files:
47+
scripts:
48+
- ../../includes/gen_ref_nav.py
49+
- literate-nav:
50+
nav_file: SUMMARY.md
51+
- section-index
52+
- glightbox
53+
- mkdocstrings:
54+
default_handler: python
55+
handlers:
56+
python:
57+
options:
58+
show_source: true
59+
show_root_heading: true
60+
show_category_heading: true
61+
merge_init_into_class: true
62+
members: true
63+
paths: [measurement]
64+
- caption:
65+
figure:
66+
ignore_classes: ["no-caption"]
67+
68+
nav:
69+
- Guía de usuario:
70+
- Introducción: introduction.md
71+
- Informes: reports.md
72+
- Permisos: permissions.md
73+
- Añadir elementos: adding_elements.md
74+
- Importar datos: importing_data.md
75+
- Validación: validation.md
76+
- Guía de desarrollo:
77+
- Contribuyendo: contributing.md
78+
- Instalación: installation.md
79+
- Control de calidad: quality_assurance.md
80+
- Datos sinteticos: synthetic_data.md
81+
- Administradores: admin.md
82+
- Estructura del código:
83+
- Índice: Applications/index.md
84+
- Formatear: Applications/formatting.md
85+
- Variables: Applications/variable.md
86+
- Sensores: Applications/sensor.md
87+
- Estationes: Applications/station.md
88+
- Mediciones: Applications/measurement.md
89+
- Importación: Applications/importing.md
90+
- API Reference: reference/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/adding_elements.md docs/en/adding_elements.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ All elements that can be created in Paricia - except for the data import, which
66

77
- Choose the element of interest from the submenu in the top bar, e.g. `Variable` within the `Variables` menu.
88

9-
![Selecting a element from the top menu](images/selecting_component.png)
9+
![Selecting a element from the top menu](../assets/images/selecting_component.png)
1010

1111
- The page now displays the list of existing elements of that type that the user can view - i.e., those that are public or that are their own. You can sort the entries clicking on the column names or filter them to select just some entries.
1212

13-
![List of variables a user can view](images/variables_list.png)
13+
![List of variables a user can view](../assets/images/variables_list.png)
1414

1515
- Clicking on an existing element ID allows to view the details of that element and to edit it, if the user has permission to do so.
1616
- Clicking on the `New` button at the top allows to create a new element of that type.
@@ -21,7 +21,7 @@ Some elements are very simple and have just one or two fields to complete. Other
2121

2222
Let's take the variables creation form as an example.
2323

24-
![Form used to create a new variable](images/variable_creation.png)
24+
![Form used to create a new variable](../assets/images/variable_creation.png)
2525

2626
As we can see in this form, there is a field called `Visibility`. All elements have this field and it defines who else can see the details and use the element to define their own elements.
2727

docs/admin.md docs/en/admin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ There are two ways of becoming an Admin user
66

77
1. Asking another Admin to give superuser permissions to that user. This is done via the Paricia Admin. Within the `Users` app, select the user whose permissions need changing and check the box granting the user `Superuser status`, as shown in this picture:
88

9-
![Checking the third box grants the user all Paricia permissions](images/superuser.png)
9+
![Checking the third box grants the user all Paricia permissions](../assets/images/superuser.png)
1010

1111
2. Via the command line. This is a more advanced method and typically required only when setting up Paricia for the first time, either locally for development or in a new server. We will assume that that Paricia has been launched using `docker compose`, as instructed in the [installation instructions](./installation.md#docker-deployment). The steps in this case are:
1212

File renamed without changes.

docs/importing_data.md docs/en/importing_data.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ The whole reason for Paricia to exist is to store and facilitate access to hydro
66

77
Data import is done via Paricia import listing, clicking in the `New` button at the top of the page.
88

9-
![Data import list](images/import_list.png)
9+
![Data import list](../assets/images/import_list.png)
1010

1111
A form will open in a new page, containing several fields to be filled by the users.
1212

13-
![Form to import new data](images/importing_add_data.png)
13+
![Form to import new data](../assets/images/importing_add_data.png)
1414

1515
### Format
1616

@@ -20,7 +20,7 @@ The **Format** is the most important option to choose. If the format is not corr
2020

2121
The following figure shows the classifications available for a particular format:
2222

23-
![List of variables classification into columns](images/classifications.png)
23+
![List of variables classification into columns](../assets/images/classifications.png)
2424

2525
Clicking in each classification `id` will show you more information about that particular classification. Keep in mind you might not have permission to see the details of that classification.
2626

@@ -36,18 +36,18 @@ Once the form is complete, click `Save` at the top of the page and the import pr
3636

3737
- **Not Queued**: The data ingestion has not started, yet.
3838

39-
![Data ingestion not queued](images/importing_not_queued.png)
39+
![Data ingestion not queued](../assets/images/importing_not_queued.png)
4040

4141
- **Queued**: The data ingestion has started. Data file has been opened and is being processed.
4242

43-
![Data ingestion queued](images/importing_queued.png)
43+
![Data ingestion queued](../assets/images/importing_queued.png)
4444

4545
- **Completed**: The data ingestion has completed successfully. Information on the start and end dates of the data **in the local timezone of the user**, as well as the number of records, will appear updated
4646

47-
![Data ingestion completed](images/importing_completed.png)
47+
![Data ingestion completed](../assets/images/importing_completed.png)
4848

4949
- **Failed**: The data ingestion failed. Information on what went wrong should appear in the log box at the bottom of the data import detail. Try to fix the issues, based on the feedback provided, check the box `Reprocess Data`, and save the form again to trigger another data ingestion process.
5050

51-
![Data ingestion failed](images/importing_failed.png)
51+
![Data ingestion failed](../assets/images/importing_failed.png)
5252

5353
Once the data has been ingested successfully, it will be available to validate in the [Validation screen](validation.md) and in the Report screen, if the Station it belongs to is labelled as public or internal.

docs/index.md docs/en/index.md

File renamed without changes.

docs/installation.md docs/en/installation.md

+18-8
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,17 @@ python -m pip install -r requirements-dev.txt
3636
python -m pip install -r requirements-doc.txt
3737
```
3838

39+
Then, paricia itself can be installed with:
40+
41+
```
42+
python -m pip install -e .
43+
```
44+
3945
That should be it. The virtual environment should be ready for the development of Paricia and its documentation. Just indicate your code editor which environment you are using in case it does not pick it automatically.
4046

4147
!!! warning "Running Paricia and tests"
4248

43-
You will not be able to run Paricia itself or the tests from the virtual environment as a TimescaleDB is required for that, which we have not installed. See the [docker deployment](#docker-deployment) section to learn how to do that.
49+
You will not be able to run Paricia itself or the tests from the virtual environment because this requires TimescaleDB, which is not installed as part of the virtual environment. See the [docker deployment](#docker-deployment) section to learn how to do that.
4450

4551
## Docker deployment
4652

@@ -72,18 +78,22 @@ Unless you destroy the docker volume containing the database or manually flush i
7278

7379
The documentation uses [`mkdocs`](https://www.mkdocs.org/). This should have been installed alongside all the other doc-related dependencies if you run `python -m pip install -r requirements-doc.txt`, as described above. There's no need to use `docker` to build the documentation locally.
7480

75-
To test the documentation live and have it rebuilt automatically while you edit the documentation files, run:
81+
Because of the multilingual nature of the documentation, the normal way to serve the documentation (via the commands 'mkdocs build' and 'mkdocs serve') will not work here. Instead you need to use the following commands to build the documentation:
7682

7783
```
78-
mkdocs serve -a localhost:8001
84+
mkdocs build -f config/en/mkdocs.yml
85+
mkdocs build -f config/es/mkdocs.yml
7986
```
8087

81-
The reason for explicitly using `localhost:8001` is because port `8000`, the default, will likely be already in use by Paricia web application.
82-
83-
To build the documentation as standalone html files and related resources, run instead:
88+
The documentation is now available in the sites/ folder. From there, you can serve it with the python http server:
8489

8590
```
86-
mkdocs build
91+
cd sites/
92+
python3 -m http.server 8001
8793
```
8894

89-
A new directory in the root of the project called `site` would have been created with all the files instead. Open `index.html` in the browser to check this documentation.
95+
The documentation site can now be accessed via a web browser on http://localhost:8001
96+
97+
98+
The reason for explicitly using `localhost:8001` is because port `8000`, the default, will likely be already in use by Paricia web application.
99+
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/reports.md docs/en/reports.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Paricia exposes the data it contains via the **Reports** page.
44

55
This page contains a form on the left hand side and a plot on the right, which will display the data selected in the form. No data is displayed in the plot when accessing the page.
66

7-
![Form to complete in the report page](images/reports_form.png)
7+
![Form to complete in the report page](../assets/images/reports_form.png)
88

99
## Report types
1010

@@ -18,7 +18,7 @@ There are 5 types of reports that can be selected:
1818

1919
All data will have a raw measurements report, but the others will be available only ifthe data has been validated.
2020

21-
## Stations, variables and date range
21+
## Stations, variables, and date range
2222

2323
The user will only be able to select stations that they can view, meaning that users that are **not logged will see only stations that are public**. Register users will see **public and internal stations**, as well as their own, if any. Check the [Permissions](./permissions.md) for more details on the permissions of each user.
2424

@@ -34,15 +34,15 @@ The user can zoom in, selecting the region of interest, and finer data will be s
3434

3535
The following figure shows the ambient temperature in a period of a few weeks. The title indicates an aggregation level of around 23 minutes, meaning that data points displayed are separated 23 minutes on average. Mind that **no processing is done in the data** - no average or other manipulation - simply a selection of existing data points are plotted across the whole range. In other words, if the original data separation was 5 min, then an aggregation level of 23 min means that only 1 point in 4 or 5 is plotted.
3636

37-
![Plot with 23.6 min data aggregation](images/high_aggregation.png)
37+
![Plot with 23.6 min data aggregation](../assets/images/high_aggregation.png)
3838

3939
In the next plot, we have zoomed in a little bit and now the average separation is 15 min.
4040

41-
![Plot with 15 min data aggregation](images/some_aggregation.png)
41+
![Plot with 15 min data aggregation](../assets/images/some_aggregation.png)
4242

4343
In the final plot, the zoom is high enough such that no aggregation is required.
4444

45-
![Plot with no data aggregation](images/no_aggregation.png)
45+
![Plot with no data aggregation](../assets/images/no_aggregation.png)
4646

4747
In all cases, to go back to the full range, either use the tools in the top right corner of the plot or double click on it.
4848

@@ -52,4 +52,4 @@ The chosen approach for selecting the data to plot - just skipping points - is e
5252

5353
For example, if we zoom in the first part of the series, we can see some - most likely wrong - data points shooting up to 50. These were not visible in the general view.
5454

55-
![Plot with spikes when there's enough zoom](images/spikes.png)
55+
![Plot with spikes when there's enough zoom](../assets/images/spikes.png)
File renamed without changes.

0 commit comments

Comments
 (0)