@@ -38,7 +38,7 @@ The best way to build the documentation is within a Python Virtual Environment (
38
38
39
39
You can use your own virtual env by creating it first:
40
40
41
- ```
41
+ ``` sh
42
42
# you NEED python >=3.9. Depending on distro either use `python3` or `python`
43
43
# common name is 'venv' but call it whatever you like
44
44
@@ -47,25 +47,25 @@ python3 -m venv venv # using the venv module, create a venv named 'venv'
47
47
48
48
Then activate the venv:
49
49
50
- ```
50
+ ``` sh
51
51
source ./venv/bin/activate
52
52
```
53
53
54
54
With 'activated' virtualenv, you should see 'venv' in the prompt. Install the requirements via the REQUIREMENTS.txt:
55
55
56
- ```
56
+ ``` sh
57
57
pip install -r REQUIREMENTS.txt
58
58
```
59
59
60
60
And run the build from within that venv:
61
61
62
- ```
62
+ ``` sh
63
63
make html
64
64
```
65
65
66
66
Want to build your own language? Note that you will use the translations from the po files from git! For example for 'nl' do:
67
67
68
- ```
68
+ ``` sh
69
69
make LANG=nl html
70
70
```
71
71
@@ -75,14 +75,14 @@ make LANG=nl html
75
75
The ` venv.mk ` file will create/update a virtual env (if not available) in current dir/venv
76
76
AND run the html build in it.
77
77
78
- ```
78
+ ``` sh
79
79
make -f venv.mk html
80
80
```
81
81
</details >
82
82
83
83
If, for some reason, you want to (re)start from scratch:
84
84
85
- ```
85
+ ``` sh
86
86
make -f venv.mk cleanall
87
87
```
88
88
@@ -91,32 +91,32 @@ make -f venv.mk cleanall
91
91
Create a virtual environment called 'venv' in that directory (search the Internet for Python Virtual
92
92
Env on Windows for more details), but in short: use the module 'venv' to create a virtual environment called 'venv'
93
93
94
- ```
94
+ ``` cmd
95
95
# in dos box:
96
96
python -m venv venv
97
97
```
98
98
99
99
Then activate the venv:
100
100
101
- ```
101
+ ``` cmd
102
102
venv\Scripts\activate.bat
103
103
```
104
104
105
105
With 'activated' virtualenv, you should see 'venv' in the prompt. Install the requirements via the REQUIREMENTS.txt:
106
106
107
- ```
107
+ ``` cmd
108
108
pip install -r REQUIREMENTS.txt
109
109
```
110
110
111
111
And run the build from within that venv, using the make.bat script with the html argument to locally build the docs:
112
112
113
- ```
113
+ ``` cmd
114
114
make.bat html
115
115
```
116
116
117
117
Want to build your own language? Note that you will use the translations from the po files from git! For example 'nl' do:
118
118
119
- ```
119
+ ``` cmd
120
120
set SPHINXOPTS=-D language=nl
121
121
make.bat html
122
122
```
@@ -125,25 +125,25 @@ make.bat html
125
125
126
126
In Linux, you can also build the PDF versions of the main documents.
127
127
128
- ```
128
+ ``` sh
129
129
make -f venv.mk pdf
130
130
```
131
131
132
132
Or after you enabled the venv:
133
133
134
- ```
134
+ ``` sh
135
135
make pdf
136
136
```
137
137
138
138
If you want to build PDFs in a language other than English, you can use a similar syntax:
139
139
140
- ```
140
+ ``` sh
141
141
make LANG=fr pdf
142
142
```
143
143
144
144
For building PDFs in English you will need to install the XeLaTex compiler package ` texlive-xetex ` and GNU Freefont.
145
145
146
- ```
146
+ ``` sh
147
147
sudo apt install texlive-xetex fonts-freefont-otf
148
148
```
149
149
@@ -183,7 +183,7 @@ and some custom scripts:
183
183
source files and their translation in the GitHub repository and link them to
184
184
the resources in Transifex.
185
185
1 . Force-push the translation files to Transifex
186
- ```
186
+ ``` sh
187
187
tx push -f -t --no-interactive
188
188
```
189
189
---
@@ -204,7 +204,7 @@ and some custom scripts:
204
204
Based on the above, translated strings are automatically available in released
205
205
branch so building the docs in any translated locale is possible following
206
206
the instructions in earlier sections:
207
- ```
207
+ ` ` ` sh
208
208
make html LANG=yourlanguage
209
209
` ` `
210
210
@@ -216,14 +216,14 @@ In that case, you need to manually pull the translations from Transifex to your
216
216
217
217
1. Checkout locally the repository and target branch in git
218
218
1. Prepare the environment
219
- ```
219
+ ` ` ` sh
220
220
python3 -m venv venv
221
221
source ./venv/bin/activate
222
222
pip install -r REQUIREMENTS.txt
223
223
` ` `
224
224
1. Install [Transifex command line client](https://github.com/transifex/cli/).
225
225
On Linux or macOS:
226
- ```
226
+ ` ` ` sh
227
227
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
228
228
# and restart the terminal
229
229
` ` `
@@ -233,11 +233,11 @@ In that case, you need to manually pull the translations from Transifex to your
233
233
234
234
1. Download the translated strings using the [minimize_translation script](scripts/minimize_translation.sh).
235
235
By default this pulls all the languages.
236
- ```
236
+ ` ` ` sh
237
237
./scripts/minimize_translation.sh
238
238
` ` `
239
239
To pull a specific language (e.g. italian), do
240
- ```
240
+ ` ` ` sh
241
241
./scripts/minimize_translation.sh -l it
242
242
` ` `
243
243
@@ -250,7 +250,7 @@ In that case, you need to manually pull the translations from Transifex to your
250
250
token = yourtransifextoken
251
251
```
252
252
1. Build the docs in your language
253
- ```
253
+ ```sh
254
254
make html LANG=yourlanguage
255
255
```
256
256
1 . Share the changes by opening a pull-request, allowing us to integrate
@@ -263,14 +263,14 @@ For this there are many options:
263
263
264
264
* You can use your system * QGIS* installation with * Sphinx* from Python virtual environment:
265
265
266
- ```
266
+ ``` sh
267
267
make -f venv.mk doctest
268
268
```
269
269
* You can use a manually built installation of * QGIS* . To do so, you need to:
270
270
1 . Create a custom `` Makefile `` extension on top of the `` venv.mk `` file,
271
271
for example a `` user.mk `` file with the following content:
272
272
273
- ```
273
+ ``` sh
274
274
# Root installation folder
275
275
QGIS_PREFIX_PATH = /home/user/apps/qgis-master
276
276
@@ -282,19 +282,19 @@ For this there are many options:
282
282
283
283
1. Then use it to run target ` ` doctest` ` :
284
284
285
- ```
285
+ ` ` ` sh
286
286
make -f user.mk doctest
287
287
` ` `
288
288
* Or you can run target ` ` doctest` ` inside the official * QGIS* docker image:
289
289
290
- ```
290
+ ` ` ` sh
291
291
make -f docker.mk doctest
292
292
` ` `
293
293
294
294
Note that only code blocks with directive ` ` testcode` ` are tested and it is possible to run tests setup code
295
295
which does not appear in documentation with directive ` ` testsetup` ` , for example:
296
296
297
- ```
297
+ ` ` ` py
298
298
.. testsetup::
299
299
300
300
from qgis.core import QgsCoordinateReferenceSystem
0 commit comments