Replace uses of shorthand codeblock syntax to avoid issues with localization

Previously, many paragraphs in the documentation used `::` at the end of a line
as a replacement for a single colon (and `::` on the following line).
Due to this, the `::` was part of the extracted string for localization.
Weblate also showed a warning about the trailing `::`, as it's not
normally expected to be there.

This change requires translators to revalidate all modified strings.
However, considering many of those have broken code blocks due to translators
replacing `::` with `:`, it can be a good idea.

This also adds documentation writing guidelines for code blocks and admonitions.
This commit does not modify existing admonitions in any way (as this would
lead to a much larger diff, and require more localizable text to be revalidated
by translators).
This commit is contained in:
Hugo Locurcio
2025-05-28 00:43:34 +02:00
parent 75fd92dbc0
commit 8a6ad4c926
32 changed files with 580 additions and 200 deletions

View File

@@ -163,7 +163,9 @@ can use binary, hexadecimal, or decimal notation for layer masks, depending
on your preference.
The code equivalent of the above example where layers 1, 3 and 4 were enabled
would be as follows::
would be as follows:
::
# Example: Setting mask value for enabling layers 1, 3 and 4
@@ -181,7 +183,9 @@ would be as follows::
pow(2, 1-1) + pow(2, 3-1) + pow(2, 4-1)
You can also set bits independently by calling ``set_collision_layer_value(layer_number, value)``
or ``set_collision_mask_value(layer_number, value)`` on any given :ref:`CollisionObject2D <class_CollisionObject2D>` as follows::
or ``set_collision_mask_value(layer_number, value)`` on any given :ref:`CollisionObject2D <class_CollisionObject2D>` as follows:
::
# Example: Setting mask value to enable layers 1, 3, and 4.