Skip to content

Commit e41509e

Browse files
DelazJgithub-actions[bot]
authored andcommitted
Add syntax highlight
1 parent b1c2d68 commit e41509e

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

README.md

+28-28
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The best way to build the documentation is within a Python Virtual Environment (
3838

3939
You can use your own virtual env by creating it first:
4040

41-
```
41+
```sh
4242
# you NEED python >=3.9. Depending on distro either use `python3` or `python`
4343
# common name is 'venv' but call it whatever you like
4444

@@ -47,25 +47,25 @@ python3 -m venv venv # using the venv module, create a venv named 'venv'
4747

4848
Then activate the venv:
4949

50-
```
50+
```sh
5151
source ./venv/bin/activate
5252
```
5353

5454
With 'activated' virtualenv, you should see 'venv' in the prompt. Install the requirements via the REQUIREMENTS.txt:
5555

56-
```
56+
```sh
5757
pip install -r REQUIREMENTS.txt
5858
```
5959

6060
And run the build from within that venv:
6161

62-
```
62+
```sh
6363
make html
6464
```
6565

6666
Want to build your own language? Note that you will use the translations from the po files from git! For example for 'nl' do:
6767

68-
```
68+
```sh
6969
make LANG=nl html
7070
```
7171

@@ -75,14 +75,14 @@ make LANG=nl html
7575
The `venv.mk` file will create/update a virtual env (if not available) in current dir/venv
7676
AND run the html build in it.
7777

78-
```
78+
```sh
7979
make -f venv.mk html
8080
```
8181
</details>
8282

8383
If, for some reason, you want to (re)start from scratch:
8484

85-
```
85+
```sh
8686
make -f venv.mk cleanall
8787
```
8888

@@ -91,32 +91,32 @@ make -f venv.mk cleanall
9191
Create a virtual environment called 'venv' in that directory (search the Internet for Python Virtual
9292
Env on Windows for more details), but in short: use the module 'venv' to create a virtual environment called 'venv'
9393

94-
```
94+
```cmd
9595
# in dos box:
9696
python -m venv venv
9797
```
9898

9999
Then activate the venv:
100100

101-
```
101+
```cmd
102102
venv\Scripts\activate.bat
103103
```
104104

105105
With 'activated' virtualenv, you should see 'venv' in the prompt. Install the requirements via the REQUIREMENTS.txt:
106106

107-
```
107+
```cmd
108108
pip install -r REQUIREMENTS.txt
109109
```
110110

111111
And run the build from within that venv, using the make.bat script with the html argument to locally build the docs:
112112

113-
```
113+
```cmd
114114
make.bat html
115115
```
116116

117117
Want to build your own language? Note that you will use the translations from the po files from git! For example 'nl' do:
118118

119-
```
119+
```cmd
120120
set SPHINXOPTS=-D language=nl
121121
make.bat html
122122
```
@@ -125,25 +125,25 @@ make.bat html
125125

126126
In Linux, you can also build the PDF versions of the main documents.
127127

128-
```
128+
```sh
129129
make -f venv.mk pdf
130130
```
131131

132132
Or after you enabled the venv:
133133

134-
```
134+
```sh
135135
make pdf
136136
```
137137

138138
If you want to build PDFs in a language other than English, you can use a similar syntax:
139139

140-
```
140+
```sh
141141
make LANG=fr pdf
142142
```
143143

144144
For building PDFs in English you will need to install the XeLaTex compiler package `texlive-xetex` and GNU Freefont.
145145

146-
```
146+
```sh
147147
sudo apt install texlive-xetex fonts-freefont-otf
148148
```
149149

@@ -183,7 +183,7 @@ and some custom scripts:
183183
source files and their translation in the GitHub repository and link them to
184184
the resources in Transifex.
185185
1. Force-push the translation files to Transifex
186-
```
186+
```sh
187187
tx push -f -t --no-interactive
188188
```
189189
---
@@ -204,7 +204,7 @@ and some custom scripts:
204204
Based on the above, translated strings are automatically available in released
205205
branch so building the docs in any translated locale is possible following
206206
the instructions in earlier sections:
207-
```
207+
```sh
208208
make html LANG=yourlanguage
209209
```
210210

@@ -216,14 +216,14 @@ In that case, you need to manually pull the translations from Transifex to your
216216

217217
1. Checkout locally the repository and target branch in git
218218
1. Prepare the environment
219-
```
219+
```sh
220220
python3 -m venv venv
221221
source ./venv/bin/activate
222222
pip install -r REQUIREMENTS.txt
223223
```
224224
1. Install [Transifex command line client](https://github.com/transifex/cli/).
225225
On Linux or macOS:
226-
```
226+
```sh
227227
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
228228
# and restart the terminal
229229
```
@@ -233,11 +233,11 @@ In that case, you need to manually pull the translations from Transifex to your
233233

234234
1. Download the translated strings using the [minimize_translation script](scripts/minimize_translation.sh).
235235
By default this pulls all the languages.
236-
```
236+
```sh
237237
./scripts/minimize_translation.sh
238238
```
239239
To pull a specific language (e.g. italian), do
240-
```
240+
```sh
241241
./scripts/minimize_translation.sh -l it
242242
```
243243

@@ -250,7 +250,7 @@ In that case, you need to manually pull the translations from Transifex to your
250250
token = yourtransifextoken
251251
```
252252
1. Build the docs in your language
253-
```
253+
```sh
254254
make html LANG=yourlanguage
255255
```
256256
1. Share the changes by opening a pull-request, allowing us to integrate
@@ -263,14 +263,14 @@ For this there are many options:
263263

264264
* You can use your system *QGIS* installation with *Sphinx* from Python virtual environment:
265265

266-
```
266+
```sh
267267
make -f venv.mk doctest
268268
```
269269
* You can use a manually built installation of *QGIS*. To do so, you need to:
270270
1. Create a custom ``Makefile`` extension on top of the ``venv.mk`` file,
271271
for example a ``user.mk`` file with the following content:
272272

273-
```
273+
```sh
274274
# Root installation folder
275275
QGIS_PREFIX_PATH = /home/user/apps/qgis-master
276276

@@ -282,19 +282,19 @@ For this there are many options:
282282

283283
1. Then use it to run target ``doctest``:
284284

285-
```
285+
```sh
286286
make -f user.mk doctest
287287
```
288288
* Or you can run target ``doctest`` inside the official *QGIS* docker image:
289289

290-
```
290+
```sh
291291
make -f docker.mk doctest
292292
```
293293

294294
Note that only code blocks with directive ``testcode`` are tested and it is possible to run tests setup code
295295
which does not appear in documentation with directive ``testsetup``, for example:
296296

297-
```
297+
```py
298298
.. testsetup::
299299
300300
from qgis.core import QgsCoordinateReferenceSystem

0 commit comments

Comments
 (0)