Skip to content

Commit c3a8da6

Browse files
committed
Merge pull request godotengine#89316 from Mickeon/codeblock-highlighting-text-ohmygoodness
Use `[codeblock lang=text]` more often in class reference
2 parents dc91479 + 328b007 commit c3a8da6

15 files changed

+46
-46
lines changed

doc/classes/@GlobalScope.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368
<param index="1" name="curve" type="float" />
369369
<description>
370370
Returns an "eased" value of [param x] based on an easing function defined with [param curve]. This easing function is based on an exponent. The [param curve] can be any floating-point number, with specific values leading to the following behaviors:
371-
[codeblock]
371+
[codeblock lang=text]
372372
- Lower than -1.0 (exclusive): Ease in-out
373373
- 1.0: Linear
374374
- Between -1.0 and 0.0 (exclusive): Ease out-in
@@ -460,8 +460,8 @@
460460
var x = i * 0.5 - 1.5
461461
print("%4.1f %4.1f | %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)])
462462
[/codeblock]
463-
Produces:
464-
[codeblock]
463+
Prints:
464+
[codeblock lang=text]
465465
(x) (fmod(x, 1.5)) (fposmod(x, 1.5))
466466
-1.5 -0.0 | 0.0
467467
-1.0 -1.0 | 0.5
@@ -818,8 +818,8 @@
818818
for i in range(-3, 4):
819819
print("%2d %2d | %2d" % [i, i % 3, posmod(i, 3)])
820820
[/codeblock]
821-
Produces:
822-
[codeblock]
821+
Prints:
822+
[codeblock lang=text]
823823
(i) (i % 3) (posmod(i, 3))
824824
-3 0 | 0
825825
-2 -2 | 1
@@ -1457,7 +1457,7 @@
14571457
[/csharp]
14581458
[/codeblocks]
14591459
Prints:
1460-
[codeblock]
1460+
[codeblock lang=text]
14611461
{
14621462
"a": 1,
14631463
"b": 2

doc/classes/ConfigFile.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</brief_description>
66
<description>
77
This helper class can be used to store [Variant] values on the filesystem using INI-style formatting. The stored values are identified by a section and a key:
8-
[codeblock]
8+
[codeblock lang=text]
99
[section]
1010
some_key=42
1111
string_example="Hello World3D!"

doc/classes/DisplayServer.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
<param index="0" name="position" type="Vector2i" />
250250
<description>
251251
Returns the ID of the window at the specified screen [param position] (in pixels). On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
252-
[codeblock]
252+
[codeblock lang=text]
253253
* (0, 0) +-------+
254254
| |
255255
+-------------+ | |
@@ -282,7 +282,7 @@
282282
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
283283
[b]Note:[/b] This method is implemented only on macOS.
284284
[b]Supported system menu IDs:[/b]
285-
[codeblock]
285+
[codeblock lang=text]
286286
"_main" - Main menu (macOS).
287287
"_dock" - Dock popup menu (macOS).
288288
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -308,7 +308,7 @@
308308
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
309309
[b]Note:[/b] This method is implemented only on macOS.
310310
[b]Supported system menu IDs:[/b]
311-
[codeblock]
311+
[codeblock lang=text]
312312
"_main" - Main menu (macOS).
313313
"_dock" - Dock popup menu (macOS).
314314
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -334,7 +334,7 @@
334334
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
335335
[b]Note:[/b] This method is implemented only on macOS.
336336
[b]Supported system menu IDs:[/b]
337-
[codeblock]
337+
[codeblock lang=text]
338338
"_main" - Main menu (macOS).
339339
"_dock" - Dock popup menu (macOS).
340340
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -361,7 +361,7 @@
361361
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
362362
[b]Note:[/b] This method is implemented only on macOS.
363363
[b]Supported system menu IDs:[/b]
364-
[codeblock]
364+
[codeblock lang=text]
365365
"_main" - Main menu (macOS).
366366
"_dock" - Dock popup menu (macOS).
367367
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -386,7 +386,7 @@
386386
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
387387
[b]Note:[/b] This method is implemented only on macOS.
388388
[b]Supported system menu IDs:[/b]
389-
[codeblock]
389+
[codeblock lang=text]
390390
"_main" - Main menu (macOS).
391391
"_dock" - Dock popup menu (macOS).
392392
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -415,7 +415,7 @@
415415
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
416416
[b]Note:[/b] This method is implemented only on macOS.
417417
[b]Supported system menu IDs:[/b]
418-
[codeblock]
418+
[codeblock lang=text]
419419
"_main" - Main menu (macOS).
420420
"_dock" - Dock popup menu (macOS).
421421
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -441,7 +441,7 @@
441441
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
442442
[b]Note:[/b] This method is implemented only on macOS.
443443
[b]Supported system menu IDs:[/b]
444-
[codeblock]
444+
[codeblock lang=text]
445445
"_main" - Main menu (macOS).
446446
"_dock" - Dock popup menu (macOS).
447447
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -459,7 +459,7 @@
459459
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
460460
[b]Note:[/b] This method is implemented only on macOS.
461461
[b]Supported system menu IDs:[/b]
462-
[codeblock]
462+
[codeblock lang=text]
463463
"_main" - Main menu (macOS).
464464
"_dock" - Dock popup menu (macOS).
465465
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -479,7 +479,7 @@
479479
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
480480
[b]Note:[/b] This method is implemented only on macOS.
481481
[b]Supported system menu IDs:[/b]
482-
[codeblock]
482+
[codeblock lang=text]
483483
"_main" - Main menu (macOS).
484484
"_dock" - Dock popup menu (macOS).
485485
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -495,7 +495,7 @@
495495
Removes all items from the global menu with ID [param menu_root].
496496
[b]Note:[/b] This method is implemented only on macOS.
497497
[b]Supported system menu IDs:[/b]
498-
[codeblock]
498+
[codeblock lang=text]
499499
"_main" - Main menu (macOS).
500500
"_dock" - Dock popup menu (macOS).
501501
"_apple" - Apple menu (macOS, custom items added before "Services").
@@ -1022,7 +1022,7 @@
10221022
Returns the dots per inch density of the specified screen. If [param screen] is [constant SCREEN_OF_MAIN_WINDOW] (the default value), a screen with the main window will be used.
10231023
[b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used.
10241024
[b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
1025-
[codeblock]
1025+
[codeblock lang=text]
10261026
ldpi - 120 dpi
10271027
mdpi - 160 dpi
10281028
hdpi - 240 dpi
@@ -1072,7 +1072,7 @@
10721072
<param index="0" name="screen" type="int" default="-1" />
10731073
<description>
10741074
Returns the screen's top-left corner position in pixels. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
1075-
[codeblock]
1075+
[codeblock lang=text]
10761076
* (0, 0) +-------+
10771077
| |
10781078
+-------------+ | |
@@ -1674,7 +1674,7 @@
16741674
<param index="1" name="window_id" type="int" default="0" />
16751675
<description>
16761676
Sets the position of the given window to [param position]. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
1677-
[codeblock]
1677+
[codeblock lang=text]
16781678
* (0, 0) +-------+
16791679
| |
16801680
+-------------+ | |

doc/classes/EditorPaths.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<description>
1818
Returns the absolute path to the user's cache folder. This folder should be used for temporary data that can be removed safely whenever the editor is closed (such as generated resource thumbnails).
1919
[b]Default paths per platform:[/b]
20-
[codeblock]
20+
[codeblock lang=text]
2121
- Windows: %LOCALAPPDATA%\Godot\
2222
- macOS: ~/Library/Caches/Godot/
2323
- Linux: ~/.cache/godot/
@@ -29,7 +29,7 @@
2929
<description>
3030
Returns the absolute path to the user's configuration folder. This folder should be used for [i]persistent[/i] user configuration files.
3131
[b]Default paths per platform:[/b]
32-
[codeblock]
32+
[codeblock lang=text]
3333
- Windows: %APPDATA%\Godot\ (same as `get_data_dir()`)
3434
- macOS: ~/Library/Application Support/Godot/ (same as `get_data_dir()`)
3535
- Linux: ~/.config/godot/
@@ -41,7 +41,7 @@
4141
<description>
4242
Returns the absolute path to the user's data folder. This folder should be used for [i]persistent[/i] user data files such as installed export templates.
4343
[b]Default paths per platform:[/b]
44-
[codeblock]
44+
[codeblock lang=text]
4545
- Windows: %APPDATA%\Godot\ (same as `get_config_dir()`)
4646
- macOS: ~/Library/Application Support/Godot/ (same as `get_config_dir()`)
4747
- Linux: ~/.local/share/godot/

doc/classes/FileAccess.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter [param delim] to use other than the default [code]","[/code] (comma). This delimiter must be one-character long, and cannot be a double quotation mark.
132132
Text is interpreted as being UTF-8 encoded. Text values must be enclosed in double quotes if they include the delimiter character. Double quotes within a text value can be escaped by doubling their occurrence.
133133
For example, the following CSV lines are valid and will be properly parsed as two strings each:
134-
[codeblock]
134+
[codeblock lang=text]
135135
Alice,"Hello, Bob!"
136136
Bob,Alice! What a surprise!
137137
Alice,"I thought you'd reply with ""Hello, world""."

doc/classes/InputEventKey.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants or any valid Unicode character.
6767
For keyboard layouts with a single label on the key, it is equivalent to [member keycode].
6868
To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.key_label)[/code] where [code]event[/code] is the [InputEventKey].
69-
[codeblock]
69+
[codeblock lang=text]
7070
+-----+ +-----+
7171
| Q | | Q | - "Q" - keycode
7272
| Й | | ض | - "Й" and "ض" - key_label
@@ -76,7 +76,7 @@
7676
<member name="keycode" type="int" setter="set_keycode" getter="get_keycode" enum="Key" default="0">
7777
Latin label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants.
7878
To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.keycode)[/code] where [code]event[/code] is the [InputEventKey].
79-
[codeblock]
79+
[codeblock lang=text]
8080
+-----+ +-----+
8181
| Q | | Q | - "Q" - keycode
8282
| Й | | ض | - "Й" and "ض" - key_label

doc/classes/Node.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@
383383
Fetches a node. The [NodePath] can either be a relative path (from this node), or an absolute path (from the [member SceneTree.root]) to a node. If [param path] does not point to a valid node, generates an error and returns [code]null[/code]. Attempts to access methods on the return value will result in an [i]"Attempt to call &lt;method&gt; on a null instance."[/i] error.
384384
[b]Note:[/b] Fetching by absolute path only works when the node is inside the scene tree (see [method is_inside_tree]).
385385
[b]Example:[/b] Assume this method is called from the Character node, inside the following tree:
386-
[codeblock]
386+
[codeblock lang=text]
387387
┖╴root
388388
┠╴Character (you are here!)
389389
┃ ┠╴Sword
@@ -514,8 +514,8 @@
514514
<return type="String" />
515515
<description>
516516
Returns the tree as a [String]. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the [method get_node] function. It also can be used in game UI/UX.
517-
[b]Example output:[/b]
518-
[codeblock]
517+
May print, for example:
518+
[codeblock lang=text]
519519
TheGame
520520
TheGame/Menu
521521
TheGame/Menu/Label
@@ -529,8 +529,8 @@
529529
<return type="String" />
530530
<description>
531531
Similar to [method get_tree_string], this returns the tree as a [String]. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees.
532-
[b]Example output:[/b]
533-
[codeblock]
532+
May print, for example:
533+
[codeblock lang=text]
534534
┖╴TheGame
535535
┠╴Menu
536536
┃ ┠╴Label
@@ -716,8 +716,8 @@
716716
<return type="void" />
717717
<description>
718718
Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs [NodePath]s relative to this node, and is good for copy/pasting into [method get_node]. See also [method print_tree_pretty].
719-
[b]Example output:[/b]
720-
[codeblock]
719+
May print, for example:
720+
[codeblock lang=text]
721721
.
722722
Menu
723723
Menu/Label
@@ -731,8 +731,8 @@
731731
<return type="void" />
732732
<description>
733733
Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to [method print_tree], but the graphical representation looks like what is displayed in the editor's Scene dock. It is useful for inspecting larger trees.
734-
[b]Example output:[/b]
735-
[codeblock]
734+
May print, for example:
735+
[codeblock lang=text]
736736
┖╴TheGame
737737
┠╴Menu
738738
┃ ┠╴Label

doc/classes/ProjectSettings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@
969969
The command-line arguments to append to Godot's own command line when running the project. This doesn't affect the editor itself.
970970
It is possible to make another executable run Godot by using the [code]%command%[/code] placeholder. The placeholder will be replaced with Godot's own command line. Program-specific arguments should be placed [i]before[/i] the placeholder, whereas Godot-specific arguments should be placed [i]after[/i] the placeholder.
971971
For example, this can be used to force the project to run on the dedicated GPU in an NVIDIA Optimus system on Linux:
972-
[codeblock]
972+
[codeblock lang=text]
973973
prime-run %command%
974974
[/codeblock]
975975
</member>
@@ -2855,7 +2855,7 @@
28552855
<member name="rendering/vrs/texture" type="String" setter="" getter="" default="&quot;&quot;">
28562856
If [member rendering/vrs/mode] is set to [b]Texture[/b], this is the path to default texture loaded as the VRS image.
28572857
The texture [i]must[/i] use a lossless compression format so that colors can be matched precisely. The following VRS densities are mapped to various colors, with brighter colors representing a lower level of shading precision:
2858-
[codeblock]
2858+
[codeblock lang=text]
28592859
- 1×1 = rgb(0, 0, 0) - #000000
28602860
- 1×2 = rgb(0, 85, 0) - #005500
28612861
- 2×1 = rgb(85, 0, 0) - #550000

doc/classes/RenderingServer.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,7 @@
25762576
<description>
25772577
Set the entire data to use for drawing the [param multimesh] at once to [param buffer] (such as instance transforms and colors). [param buffer]'s size must match the number of instances multiplied by the per-instance data size (which depends on the enabled MultiMesh fields). Otherwise, an error message is printed and nothing is rendered. See also [method multimesh_get_buffer].
25782578
The per-instance data size and expected data order is:
2579-
[codeblock]
2579+
[codeblock lang=text]
25802580
2D:
25812581
- Position: 8 floats (8 floats for Transform2D)
25822582
- Position + Vertex color: 12 floats (8 floats for Transform2D, 4 floats for Color)

doc/classes/ResourceImporterCSVTranslation.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<description>
77
Comma-separated values are a plain text table storage format. The format's simplicity makes it easy to edit in any text editor or spreadsheet software. This makes it a common choice for game localization.
88
[b]Example CSV file:[/b]
9-
[codeblock]
9+
[codeblock lang=text]
1010
keys,en,es,ja
1111
GREET,"Hello, friend!","Hola, amigo!",こんにちは
1212
ASK,How are you?,Cómo está?,元気ですか

0 commit comments

Comments
 (0)