Skip to content

Commit 1c15870

Browse files
committed
Replace remaining uses of shorthand codeblock syntax, add CI check
1 parent de83a7f commit 1c15870

22 files changed

+243
-120
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
- name: Style checks via pre-commit
2020
uses: pre-commit/action@v3.0.1
2121

22+
- name: Custom RST checks (check-rst.sh)
23+
run: |
24+
bash ./_tools/check-rst.sh
25+
2226
- name: Get Python version
2327
id: pythonv
2428
run: |

_tools/check-rst.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -uo pipefail
4+
5+
output=$(grep -r -P '^(?!\s*\.\.).*\S::$' --include='*.rst' --exclude='docs_writing_guidelines.rst' .)
6+
if [[ -n $output ]]; then
7+
echo 'The shorthand codeblock syntax (trailing `::`) is not allowed.'
8+
echo "$output"
9+
exit 1
10+
fi

contributing/development/code_style_guidelines.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ To set up:
7373

7474
::
7575

76-
pip install pre-commit
77-
pre-commit install
76+
pip install pre-commit
77+
pre-commit install
7878

7979

8080
You can also run the hook manually with ``pre-commit run``.

contributing/development/compiling/compiling_for_linuxbsd.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,15 @@ And then use the ``--headless`` command line argument:
314314
./bin/godot.linuxbsd.editor.x86_64 --headless
315315

316316
To compile a debug *server* build which can be used with
317-
:ref:`remote debugging tools <doc_command_line_tutorial>`, use::
317+
:ref:`remote debugging tools <doc_command_line_tutorial>`, use:
318+
319+
::
318320

319321
scons platform=linuxbsd target=template_debug
320322

321-
To compile a *server* build which is optimized to run dedicated game servers,
322-
use::
323+
To compile a *server* build which is optimized to run dedicated game servers, use:
324+
325+
::
323326

324327
scons platform=linuxbsd target=template_release production=yes
325328

@@ -363,7 +366,7 @@ must be copied to:
363366

364367
and named like this (even for \*BSD which is seen as "Linux/X11" by Godot):
365368

366-
::
369+
.. code:: text
367370
368371
linux_debug.arm32
369372
linux_debug.arm64
@@ -449,7 +452,7 @@ indicates to Clang the target architecture, and OS we want to build for.
449452
If all went well, you should now see a ``bin`` directory, and within it,
450453
a binary similar to the following:
451454

452-
::
455+
.. code:: text
453456
454457
godot.linuxbsd.editor.rv64.llvm
455458
@@ -486,7 +489,7 @@ link-time optimization, making the resulting binaries smaller and faster.
486489

487490
If this error occurs:
488491

489-
::
492+
.. code:: text
490493
491494
/usr/bin/ld: cannot find -l:libatomic.a: No such file or directory
492495
@@ -517,7 +520,9 @@ repositories, so you will have to install its binaries manually.
517520
PATH="$HOME/.local/share/mold/bin:$PATH"
518521

519522
- Open a new terminal (or run ``source "$HOME/.bash_profile"``),
520-
then use the following SCons command when compiling Godot::
523+
then use the following SCons command when compiling Godot:
524+
525+
::
521526

522527
scons platform=linuxbsd linker=mold
523528

contributing/development/compiling/compiling_for_macos.rst

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ Compiling
5353

5454
Start a terminal, go to the root directory of the engine source code.
5555

56-
To compile for Intel (x86-64) powered Macs, use::
56+
To compile for Intel (x86-64) powered Macs, use:
57+
58+
::
5759

5860
scons platform=macos arch=x86_64
5961

60-
To compile for Apple Silicon (ARM64) powered Macs, use::
62+
To compile for Apple Silicon (ARM64) powered Macs, use:
63+
64+
::
6165

6266
scons platform=macos arch=arm64
6367

@@ -102,7 +106,9 @@ run the above two commands and then use ``lipo`` to bundle them together:
102106
lipo -create bin/godot.macos.editor.x86_64 bin/godot.macos.editor.arm64 -output bin/godot.macos.editor.universal
103107

104108
To create an ``.app`` bundle, you need to use the template located in ``misc/dist/macos_tools.app``. Typically, for an optimized
105-
editor binary built with ``dev_build=yes``::
109+
editor binary built with ``dev_build=yes``:
110+
111+
::
106112

107113
cp -r misc/dist/macos_tools.app ./bin/Godot.app
108114
mkdir -p bin/Godot.app/Contents/MacOS
@@ -116,7 +122,9 @@ editor binary built with ``dev_build=yes``::
116122
for the MoltenVK Vulkan portability library. By default, it will be linked
117123
statically from your installation of the Vulkan SDK for macOS.
118124
You can also choose to link it dynamically by passing ``use_volk=yes`` and
119-
including the dynamic library in your ``.app`` bundle::
125+
including the dynamic library in your ``.app`` bundle:
126+
127+
::
120128

121129
mkdir -p <Godot bundle name>.app/Contents/Frameworks
122130
cp <Vulkan SDK path>/macOS/lib/libMoltenVK.dylib <Godot bundle name>.app/Contents/Frameworks/libMoltenVK.dylib
@@ -138,12 +146,15 @@ And then use the ``--headless`` command line argument:
138146
./bin/godot.macos.editor.x86_64 --headless
139147

140148
To compile a debug *server* build which can be used with
141-
:ref:`remote debugging tools <doc_command_line_tutorial>`, use::
149+
:ref:`remote debugging tools <doc_command_line_tutorial>`, use:
150+
151+
::
142152

143153
scons platform=macos target=template_debug
144154

145-
To compile a release *server* build which is optimized to run dedicated game servers,
146-
use::
155+
To compile a release *server* build which is optimized to run dedicated game servers, use:
156+
157+
::
147158

148159
scons platform=macos target=template_release production=yes
149160

@@ -157,17 +168,21 @@ the editor: ``target=template_release`` (release template) and
157168
Official templates are *Universal 2* binaries which support both ARM64 and Intel
158169
x86_64 architectures.
159170

160-
- To support ARM64 (Apple Silicon) + Intel x86_64::
171+
- To support ARM64 (Apple Silicon) + Intel x86_64:
161172

162-
scons platform=macos target=template_debug arch=arm64
163-
scons platform=macos target=template_release arch=arm64
164-
scons platform=macos target=template_debug arch=x86_64
165-
scons platform=macos target=template_release arch=x86_64 generate_bundle=yes
173+
::
166174

167-
- To support ARM64 (Apple Silicon) only (smaller file size, but less compatible with older hardware)::
175+
scons platform=macos target=template_debug arch=arm64
176+
scons platform=macos target=template_release arch=arm64
177+
scons platform=macos target=template_debug arch=x86_64
178+
scons platform=macos target=template_release arch=x86_64 generate_bundle=yes
168179

169-
scons platform=macos target=template_debug arch=arm64
170-
scons platform=macos target=template_release arch=arm64 generate_bundle=yes
180+
- To support ARM64 (Apple Silicon) only (smaller file size, but less compatible with older hardware):
181+
182+
::
183+
184+
scons platform=macos target=template_debug arch=arm64
185+
scons platform=macos target=template_release arch=arm64 generate_bundle=yes
171186

172187
To create an ``.app`` bundle like in the official builds, you need to use the
173188
template located in ``misc/dist/macos_template.app``. This process can be automated by using
@@ -181,7 +196,9 @@ an *Universal 2* binary from two separate ARM64 and x86_64 binaries (if both wer
181196
library. By default, it will be linked statically from your installation of
182197
the Vulkan SDK for macOS. You can also choose to link it dynamically by
183198
passing ``use_volk=yes`` and including the dynamic library in your ``.app``
184-
bundle::
199+
bundle:
200+
201+
::
185202

186203
mkdir -p macos_template.app/Contents/Frameworks
187204
cp <Vulkan SDK path>/macOS/libs/libMoltenVK.dylib macos_template.app/Contents/Frameworks/libMoltenVK.dylib
@@ -206,8 +223,9 @@ Windows using the Windows Subsystem for Linux). For that, you'll need to install
206223
as a target. First, follow the instructions to install it:
207224

208225
Clone the `OSXCross repository <https://github.com/tpoechtrager/osxcross>`__
209-
somewhere on your machine (or download a ZIP file and extract it somewhere),
210-
e.g.::
226+
somewhere on your machine (or download a ZIP file and extract it somewhere), e.g.:
227+
228+
::
211229

212230
git clone --depth=1 https://github.com/tpoechtrager/osxcross.git "$HOME/osxcross"
213231

@@ -218,7 +236,9 @@ e.g.::
218236

219237
After that, you will need to define the ``OSXCROSS_ROOT`` as the path to
220238
the OSXCross installation (the same place where you cloned the
221-
repository/extracted the zip), e.g.::
239+
repository/extracted the zip), e.g.:
240+
241+
::
222242

223243
export OSXCROSS_ROOT="$HOME/osxcross"
224244

@@ -228,7 +248,9 @@ Now you can compile with SCons like you normally would:
228248

229249
scons platform=macos
230250

231-
If you have an OSXCross SDK version different from the one expected by the SCons buildsystem, you can specify a custom one with the ``osxcross_sdk`` argument::
251+
If you have an OSXCross SDK version different from the one expected by the SCons buildsystem, you can specify a custom one with the ``osxcross_sdk`` argument:
252+
253+
::
232254

233255
scons platform=macos osxcross_sdk=darwin15
234256

@@ -242,7 +264,7 @@ If you get a compilation error of this form early on, it's likely because
242264
the Xcode command line tools installation needs to be repaired after
243265
a macOS or Xcode update:
244266

245-
::
267+
.. code:: text
246268
247269
./core/typedefs.h:45:10: fatal error: 'cstdint' file not found
248270
45 | #include <cstdint>

contributing/development/compiling/compiling_for_windows.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,11 @@ By default, Godot is built with dynamically linked ANGLE, you can use it by plac
301301
To compile Godot with statically linked ANGLE:
302302

303303
- Download pre-built static libraries from `godot-angle-static library <https://github.com/godotengine/godot-angle-static/releases>`_, and unzip them.
304-
- When building Godot, add ``angle_libs={path}`` to tell SCons where to look for the ANGLE libraries::
304+
- When building Godot, add ``angle_libs={path}`` to tell SCons where to look for the ANGLE libraries:
305305

306-
scons platform=windows angle_libs=<...>
306+
::
307+
308+
scons platform=windows angle_libs=<...>
307309

308310
.. note:: You can optionally build the godot-angle-static libraries yourself with
309311
the following steps:
@@ -414,7 +416,9 @@ Where ``/path/to/mingw`` is the path containing the ``bin`` directory where
414416

415417
To make sure you are doing things correctly, executing the following in
416418
the shell should result in a working compiler (the version output may
417-
differ based on your system)::
419+
differ based on your system):
420+
421+
::
418422

419423
${MINGW_PREFIX}/bin/x86_64-w64-mingw32-gcc --version
420424
# x86_64-w64-mingw32-gcc (GCC) 13.2.0
@@ -432,15 +436,18 @@ Cross-compiling from some Ubuntu versions may lead to
432436
`this bug <https://github.com/godotengine/godot/issues/9258>`_,
433437
due to a default configuration lacking support for POSIX threading.
434438

435-
You can change that configuration following those instructions,
436-
for 64-bit::
439+
You can change that configuration following those instructions, for 64-bit:
440+
441+
::
437442

438443
sudo update-alternatives --config x86_64-w64-mingw32-gcc
439444
<choose x86_64-w64-mingw32-gcc-posix from the list>
440445
sudo update-alternatives --config x86_64-w64-mingw32-g++
441446
<choose x86_64-w64-mingw32-g++-posix from the list>
442447

443-
And for 32-bit::
448+
And for 32-bit:
449+
450+
::
444451

445452
sudo update-alternatives --config i686-w64-mingw32-gcc
446453
<choose i686-w64-mingw32-gcc-posix from the list>

contributing/development/compiling/compiling_with_dotnet.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ Building the managed libraries
6464
------------------------------
6565

6666
Once you have generated the .NET glue, you can build the managed libraries with
67-
the ``build_assemblies.py`` script::
67+
the ``build_assemblies.py`` script:
68+
69+
::
6870

6971
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin
7072

contributing/development/compiling/getting_source.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ and click on the link for the release you want.
4040
You can then download and extract the source from the download link on the page.
4141

4242
With ``git``, you can also clone a stable release by specifying its branch or tag
43-
after the ``--branch`` (or just ``-b``) argument::
43+
after the ``--branch`` (or just ``-b``) argument:
44+
45+
::
4446

4547
# Clone the continuously maintained stable branch (`4.4` as of writing).
4648
git clone https://github.com/godotengine/godot.git -b 4.4

contributing/development/compiling/introduction_to_the_buildsystem.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ SCons setup is configured to use all CPU threads but one (to keep the system res
5252
compilation). If you want to adjust how many CPU threads SCons will use, use the ``-j <threads>``
5353
parameter to specify how many threads will be used for the build.
5454

55-
Example for using 4 threads::
55+
Example for using 4 threads:
56+
57+
::
5658

5759
scons -j4
5860

@@ -68,7 +70,9 @@ SCons is invoked by just calling ``scons``. If no platform is specified,
6870
SCons will detect the target platform automatically based on the host platform.
6971
It will then start building for the target platform right away.
7072

71-
To list the available target platforms, use ``scons platform=list``::
73+
To list the available target platforms, use ``scons platform=list``:
74+
75+
.. code:: text
7276
7377
scons platform=list
7478
scons: Reading SConscript files ...

contributing/documentation/editor_and_docs_localization.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -217,29 +217,33 @@ The editor translations originate from C++ strings, and may use:
217217
placed in your translation where necessary for it to be meaningful after
218218
substitution. You may need to refer to the source string location to
219219
understand what kind of content will be substituted if it's not clear from the
220-
sentence. Example (``%s`` will be substituted with a file name or path)::
220+
sentence. Example (``%s`` will be substituted with a file name or path):
221221

222-
# PO file:
223-
"There is no '%s' file."
222+
::
224223

225-
# Weblate:
226-
There is no '%s' file.
224+
# PO file:
225+
"There is no '%s' file."
226+
227+
# Weblate:
228+
There is no '%s' file.
227229

228230
- **C escape characters** such as ``\n`` (line break) or ``\t`` (tabulation). In
229231
the Weblate editor, the ``\n`` characters are replaced by ```` (return) and
230232
``\t`` by ````. Tabs are not used much, but you should make sure to use line
231233
breaks in the same way as the original English string (Weblate will issue a
232234
warning if you don't). Line breaks might sometimes be used for vertical
233235
spacing, or manual wrapping of long lines which would otherwise be too long
234-
especially in the editor translation). Example::
236+
especially in the editor translation). Example:
237+
238+
::
235239

236-
# PO file:
237-
"Scene '%s' is currently being edited.\n"
238-
"Changes will only take effect when reloaded."
240+
# PO file:
241+
"Scene '%s' is currently being edited.\n"
242+
"Changes will only take effect when reloaded."
239243

240-
# Weblate:
241-
Scene '%s' is currently being edited.↵
242-
Changes will only take effect when reloaded.
244+
# Weblate:
245+
Scene '%s' is currently being edited.↵
246+
Changes will only take effect when reloaded.
243247

244248
.. note::
245249
Only logical order of the characters matters, in the right-to-left text, format
@@ -307,7 +311,9 @@ Some of the tags used are from the original BBCode (e.g. ``[b]Bold[/b]`` and
307311
``[i]Italics[/i]``), while others are Godot-specific and used for advanced
308312
features such as inline code (e.g. ``[code]true[/code]``), linking to another
309313
class (e.g. ``[Node2D]``) or to a property in a given class (e.g.
310-
``[member Node2D.position]``), or for multiline code blocks. Example::
314+
``[member Node2D.position]``), or for multiline code blocks. Example:
315+
316+
::
311317

312318
Returns a color according to the standardized [code]name[/code] with [code]alpha[/code] ranging from 0 to 1.
313319
[codeblock]

0 commit comments

Comments
 (0)