diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/AStar.xml | 4 | ||||
-rw-r--r-- | doc/classes/AStar2D.xml | 4 | ||||
-rw-r--r-- | doc/classes/ColorPicker.xml | 2 | ||||
-rw-r--r-- | doc/classes/Crypto.xml | 2 | ||||
-rw-r--r-- | doc/classes/CryptoKey.xml | 2 | ||||
-rw-r--r-- | doc/classes/Environment.xml | 7 | ||||
-rw-r--r-- | doc/classes/Font.xml | 2 | ||||
-rw-r--r-- | doc/classes/GridContainer.xml | 3 | ||||
-rw-r--r-- | doc/classes/HTTPClient.xml | 2 | ||||
-rw-r--r-- | doc/classes/MainLoop.xml | 34 | ||||
-rw-r--r-- | doc/classes/MeshLibrary.xml | 14 | ||||
-rw-r--r-- | doc/classes/Mutex.xml | 1 | ||||
-rw-r--r-- | doc/classes/OS.xml | 4 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 10 | ||||
-rw-r--r-- | doc/classes/SceneTree.xml | 6 | ||||
-rw-r--r-- | doc/classes/SceneTreeTimer.xml | 6 | ||||
-rw-r--r-- | doc/classes/Semaphore.xml | 1 | ||||
-rw-r--r-- | doc/classes/Skeleton.xml | 19 | ||||
-rw-r--r-- | doc/classes/SurfaceTool.xml | 1 | ||||
-rw-r--r-- | doc/classes/TextureProgress.xml | 2 | ||||
-rw-r--r-- | doc/classes/Thread.xml | 1 | ||||
-rw-r--r-- | doc/classes/TreeItem.xml | 11 | ||||
-rw-r--r-- | doc/classes/VisualShaderNode.xml | 7 | ||||
-rw-r--r-- | doc/classes/X509Certificate.xml | 2 | ||||
-rwxr-xr-x | doc/tools/makerst.py | 5 |
25 files changed, 106 insertions, 46 deletions
diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index 9ca09371dd..e835af01e8 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -110,8 +110,10 @@ </return> <argument index="0" name="to_position" type="Vector3"> </argument> + <argument index="1" name="include_disabled" type="bool" default="false"> + </argument> <description> - Returns the ID of the closest point to [code]to_position[/code]. Returns -1 if there are no points in the points pool. + Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns -1 if there are no points in the points pool. </description> </method> <method name="get_closest_position_in_segment" qualifiers="const"> diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 0eff2bd560..3002e3c351 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -87,8 +87,10 @@ </return> <argument index="0" name="to_position" type="Vector2"> </argument> + <argument index="1" name="include_disabled" type="bool" default="false"> + </argument> <description> - Returns the ID of the closest point to [code]to_position[/code]. Returns -1 if there are no points in the points pool. + Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns -1 if there are no points in the points pool. </description> </method> <method name="get_closest_position_in_segment" qualifiers="const"> diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index b62eb443d9..cd36f4fdf0 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -97,6 +97,8 @@ </theme_item> <theme_item name="margin" type="int" default="4"> </theme_item> + <theme_item name="overbright_indicator" type="Texture"> + </theme_item> <theme_item name="preset_bg" type="Texture"> </theme_item> <theme_item name="screen_picker" type="Texture"> diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml index 4ec405f96c..bce7895973 100644 --- a/doc/classes/Crypto.xml +++ b/doc/classes/Crypto.xml @@ -41,7 +41,7 @@ <argument index="0" name="size" type="int"> </argument> <description> - Generates an RSA [CryptoKey] that can be used for creating self-signed certificates and passed to [method StreamPeerSSL.acccept_stream]. + Generates an RSA [CryptoKey] that can be used for creating self-signed certificates and passed to [method StreamPeerSSL.accept_stream]. </description> </method> <method name="generate_self_signed_certificate"> diff --git a/doc/classes/CryptoKey.xml b/doc/classes/CryptoKey.xml index 6db6fea779..8c825c9e1c 100644 --- a/doc/classes/CryptoKey.xml +++ b/doc/classes/CryptoKey.xml @@ -5,7 +5,7 @@ </brief_description> <description> The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other [Resource]. - They can be used to generate a self-signed [X509Certificate] via [method Crypto.generate_self_signed] and as private key in [method StreamPeerSSL.accept_stream] along with the appropriate certificate. + They can be used to generate a self-signed [X509Certificate] via [method Crypto.generate_self_signed_certificate] and as private key in [method StreamPeerSSL.accept_stream] along with the appropriate certificate. </description> <tutorials> </tutorials> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 9a943aba51..2b44eb81b1 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -177,6 +177,7 @@ Enables fog's light transmission. If enabled, lets reflections light to be transmitted by the fog. </member> <member name="glow_bicubic_upscale" type="bool" setter="set_glow_bicubic_upscale" getter="is_glow_bicubic_upscale_enabled" default="false"> + Smooths out blockiness created by sampling higher levels. </member> <member name="glow_blend_mode" type="int" setter="set_glow_blend_mode" getter="get_glow_blend_mode" enum="Environment.GlowBlendMode" default="2"> Glow blending mode. @@ -193,10 +194,10 @@ Bleed scale of the HDR glow. </member> <member name="glow_hdr_threshold" type="float" setter="set_glow_hdr_bleed_threshold" getter="get_glow_hdr_bleed_threshold" default="1.0"> - Bleed threshold of the HDR glow. + Bleed threshold of the HDR glow. In GLES2, this needs to be below 1.0 in order for glow to be visible, a default value of 0.9 works well. </member> <member name="glow_intensity" type="float" setter="set_glow_intensity" getter="get_glow_intensity" default="0.8"> - Glow intensity. + Glow intensity. In GLES2, this should be increased to 1.5 by default to compensate for not using HDR. </member> <member name="glow_levels/1" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" default="false"> First level of glow (most local). @@ -220,7 +221,7 @@ Seventh level of glow (most global). </member> <member name="glow_strength" type="float" setter="set_glow_strength" getter="get_glow_strength" default="1.0"> - Glow strength. + Glow strength. In GLES2, this should be increased to 1.3 by default to compensate for not using HDR. </member> <member name="ss_reflections_depth_tolerance" type="float" setter="set_ssr_depth_tolerance" getter="get_ssr_depth_tolerance" default="0.2"> </member> diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index 6ec1545bc7..f7de79913c 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -82,7 +82,7 @@ </return> <argument index="0" name="string" type="String"> </argument> - <argument index="1" name="p_width" type="float"> + <argument index="1" name="width" type="float"> </argument> <description> </description> diff --git a/doc/classes/GridContainer.xml b/doc/classes/GridContainer.xml index 7656a579af..e8c764f412 100644 --- a/doc/classes/GridContainer.xml +++ b/doc/classes/GridContainer.xml @@ -4,7 +4,8 @@ Grid container used to arrange elements in a grid like layout. </brief_description> <description> - Grid container will arrange its children in a grid like structure, the grid columns are specified using the [member columns] property and the number of rows will be equal to the number of children in the container divided by the number of columns. For example, if the container has 5 children, and 2 columns, there will be 3 rows in the container. Notice that grid layout will preserve the columns and rows for every size of the container. + Grid container will arrange its children in a grid like structure, the grid columns are specified using the [member columns] property and the number of rows will be equal to the number of children in the container divided by the number of columns. For example, if the container has 5 children, and 2 columns, there will be 3 rows in the container. + Notice that grid layout will preserve the columns and rows for every size of the container, and that empty columns will be expanded automatically. </description> <tutorials> </tutorials> diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index c91ddccaa4..1a2d5cab81 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -69,7 +69,7 @@ [codeblock] { "content-length": 12, - "Content-Type": "application/json; charset=UTF-8", + "Content-Type": "application/json; charset=UTF-8", } [/codeblock] </description> diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml index 23ce20a434..9e65da8eea 100644 --- a/doc/classes/MainLoop.xml +++ b/doc/classes/MainLoop.xml @@ -15,29 +15,29 @@ var quit = false func _initialize(): - print("Initialized:") - print(" Starting time: %s" % str(time_elapsed)) + print("Initialized:") + print(" Starting time: %s" % str(time_elapsed)) func _idle(delta): - time_elapsed += delta - # Return true to end the main loop - return quit + time_elapsed += delta + # Return true to end the main loop. + return quit func _input_event(event): - # Record keys - if event is InputEventKey and event.pressed and !event.echo: - keys_typed.append(OS.get_scancode_string(event.scancode)) - # Quit on Escape press - if event.scancode == KEY_ESCAPE: - quit = true - # Quit on any mouse click - if event is InputEventMouseButton: - quit = true + # Record keys. + if event is InputEventKey and event.pressed and !event.echo: + keys_typed.append(OS.get_scancode_string(event.scancode)) + # Quit on Escape press. + if event.scancode == KEY_ESCAPE: + quit = true + # Quit on any mouse click. + if event is InputEventMouseButton: + quit = true func _finalize(): - print("Finalized:") - print(" End time: %s" % str(time_elapsed)) - print(" Keys typed: %s" % var2str(keys_typed)) + print("Finalized:") + print(" End time: %s" % str(time_elapsed)) + print(" Keys typed: %s" % var2str(keys_typed)) [/codeblock] </description> <tutorials> diff --git a/doc/classes/MeshLibrary.xml b/doc/classes/MeshLibrary.xml index 041d1fa80d..44dc4f334f 100644 --- a/doc/classes/MeshLibrary.xml +++ b/doc/classes/MeshLibrary.xml @@ -4,7 +4,7 @@ Library of meshes. </brief_description> <description> - Library of meshes. Contains a list of [Mesh] resources, each with name and ID. This resource is used in [GridMap]. + A library of meshes. Contains a list of [Mesh] resources, each with a name and ID. This resource is used in [GridMap]. </description> <tutorials> </tutorials> @@ -13,7 +13,7 @@ <return type="void"> </return> <description> - Clear the library. + Clears the library. </description> </method> <method name="create_item"> @@ -22,7 +22,7 @@ <argument index="0" name="id" type="int"> </argument> <description> - Create a new item in the library, supplied an id. + Create a new item in the library, supplied as an ID. </description> </method> <method name="find_item_by_name" qualifiers="const"> @@ -80,6 +80,8 @@ <argument index="0" name="id" type="int"> </argument> <description> + Returns a generated item preview (a 3D rendering in isometric perspective). + [b]Note:[/b] Since item previews are only generated in an editor context, this function will return an empty [Texture] in a running project. </description> </method> <method name="get_item_shapes" qualifiers="const"> @@ -94,7 +96,7 @@ <return type="int"> </return> <description> - Gets an unused id for a new item. + Gets an unused ID for a new item. </description> </method> <method name="remove_item"> @@ -114,7 +116,7 @@ <argument index="1" name="mesh" type="Mesh"> </argument> <description> - Sets the mesh of the item. + Sets the item's mesh. </description> </method> <method name="set_item_name"> @@ -125,7 +127,7 @@ <argument index="1" name="name" type="String"> </argument> <description> - Sets the name of the item. + Sets the item's name. </description> </method> <method name="set_item_navmesh"> diff --git a/doc/classes/Mutex.xml b/doc/classes/Mutex.xml index 793696321b..8a294425e6 100644 --- a/doc/classes/Mutex.xml +++ b/doc/classes/Mutex.xml @@ -7,6 +7,7 @@ A synchronization mutex (mutual exclusion). This is used to synchronize multiple [Thread]s, and is equivalent to a binary [Semaphore]. It guarantees that only one thread can ever acquire the lock at a time. A mutex can be used to protect a critical section; however, be careful to avoid deadlocks. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link> </tutorials> <methods> <method name="lock"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 9f61245819..9acddb3115 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -105,11 +105,11 @@ This method has slightly different behavior based on whether the [code]blocking[/code] mode is enabled. If [code]blocking[/code] is [code]true[/code], the Godot thread will pause its execution while waiting for the process to terminate. The shell output of the process will be written to the [code]output[/code] array as a single string. When the process terminates, the Godot thread will resume execution. If [code]blocking[/code] is [code]false[/code], the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so [code]output[/code] will be empty. - The return value also depends on the blocking mode. When blocking, the method will return -2 (no process ID information is available in blocking mode). When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). If the process forking (non-blocking) or opening (blocking) fails, the method will return [code]-1[/code]. + The return value also depends on the blocking mode. When blocking, the method will return an exit code of the process. When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). If the process forking (non-blocking) or opening (blocking) fails, the method will return [code]-1[/code] or another exit code. Example of blocking mode and retrieving the shell output: [codeblock] var output = [] - OS.execute("ls", ["-l", "/tmp"], true, output) + var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output) [/codeblock] Example of non-blocking mode, running another instance of the project and storing its process ID: [codeblock] diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 3da403c681..7d009252c0 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -5,6 +5,7 @@ </brief_description> <description> Contains global variables accessible from everywhere. Use [method get_setting], [method set_setting] or [method has_setting] to access them. Variables stored in [code]project.godot[/code] are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options. + When naming a Project Settings property, use the full path to the setting including the category. For example, [code]"application/config/name"[/code] for the project name. Category and property names can be viewed in the Project Settings dialog. </description> <tutorials> </tutorials> @@ -55,6 +56,11 @@ <argument index="0" name="name" type="String"> </argument> <description> + Returns the value of a setting. + [b]Example:[/b] + [codeblock] + print(ProjectSettings.get_setting("application/config/name")) + [/codeblock] </description> </method> <method name="globalize_path" qualifiers="const"> @@ -80,9 +86,11 @@ </return> <argument index="0" name="pack" type="String"> </argument> + <argument index="1" name="replace_files" type="bool" default="true"> + </argument> <description> Loads the contents of the .pck or .zip file specified by [code]pack[/code] into the resource filesystem ([code]res://[/code]). Returns [code]true[/code] on success. - [b]Note:[/b] If a file from [code]pack[/code] shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from [code]pack[/code]. + [b]Note:[/b] If a file from [code]pack[/code] shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from [code]pack[/code] unless [code]replace_files[/code] is set to [code]false[/code]. </description> </method> <method name="localize_path" qualifiers="const"> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index ed43f83f05..bd81a48ff5 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -69,9 +69,9 @@ Commonly used to create a one-shot delay timer as in the following example: [codeblock] func some_function(): - print("start") - yield(get_tree().create_timer(1.0), "timeout") - print("end") + print("start") + yield(get_tree().create_timer(1.0), "timeout") + print("end") [/codeblock] </description> </method> diff --git a/doc/classes/SceneTreeTimer.xml b/doc/classes/SceneTreeTimer.xml index a33f875be2..5678833752 100644 --- a/doc/classes/SceneTreeTimer.xml +++ b/doc/classes/SceneTreeTimer.xml @@ -8,9 +8,9 @@ As opposed to [Timer], it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example: [codeblock] func some_function(): - print("start") - yield(get_tree().create_timer(1.0), "timeout") - print("end") + print("Timer started.") + yield(get_tree().create_timer(1.0), "timeout") + print("Timer ended.") [/codeblock] </description> <tutorials> diff --git a/doc/classes/Semaphore.xml b/doc/classes/Semaphore.xml index 7aee5c2951..74970be8b4 100644 --- a/doc/classes/Semaphore.xml +++ b/doc/classes/Semaphore.xml @@ -7,6 +7,7 @@ A synchronization semaphore which can be used to synchronize multiple [Thread]s. Initialized to zero on creation. Be careful to avoid deadlocks. For a binary version, see [Mutex]. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link> </tutorials> <methods> <method name="post"> diff --git a/doc/classes/Skeleton.xml b/doc/classes/Skeleton.xml index 27a78cd7d1..7cd95390e6 100644 --- a/doc/classes/Skeleton.xml +++ b/doc/classes/Skeleton.xml @@ -54,6 +54,15 @@ Returns the amount of bones in the skeleton. </description> </method> + <method name="get_bone_custom_pose" qualifiers="const"> + <return type="Transform"> + </return> + <argument index="0" name="bone_idx" type="int"> + </argument> + <description> + Returns the custom pose of the specified bone. Custom pose is applied on top of the rest pose. + </description> + </method> <method name="get_bone_global_pose" qualifiers="const"> <return type="Transform"> </return> @@ -161,6 +170,16 @@ <description> </description> </method> + <method name="set_bone_custom_pose"> + <return type="void"> + </return> + <argument index="0" name="bone_idx" type="int"> + </argument> + <argument index="1" name="custom_pose" type="Transform"> + </argument> + <description> + </description> + </method> <method name="set_bone_disable_rest"> <return type="void"> </return> diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 153d88f1af..7cfd8c6919 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -167,6 +167,7 @@ </argument> <description> Returns a constructed [ArrayMesh] from current information passed in. If an existing [ArrayMesh] is passed in as an argument, will add an extra surface to the existing [ArrayMesh]. + Default flag is [constant Mesh.ARRAY_COMPRESS_DEFAULT]. See [code]Mesh.ARRAY_COMPRESS_*[/code] constants for other flags. </description> </method> <method name="commit_to_arrays"> diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgress.xml index 21b294cf90..479ab865ba 100644 --- a/doc/classes/TextureProgress.xml +++ b/doc/classes/TextureProgress.xml @@ -34,7 +34,7 @@ </member> <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" override="true" enum="Control.MouseFilter" default="1" /> <member name="nine_patch_stretch" type="bool" setter="set_nine_patch_stretch" getter="get_nine_patch_stretch" default="false"> - If [code]true[/code], Godot treats the bar's textures like in [NinePatchRect]. Use the [code]stretch_margin_*[/code] properties like [member stretch_margin_bottom] to set up the nine patch's 3×3 grid. + If [code]true[/code], Godot treats the bar's textures like in [NinePatchRect]. Use the [code]stretch_margin_*[/code] properties like [member stretch_margin_bottom] to set up the nine patch's 3×3 grid. When using a radial [member fill_mode], this setting will enable stretching. </member> <member name="radial_center_offset" type="Vector2" setter="set_radial_center_offset" getter="get_radial_center_offset" default="Vector2( 0, 0 )"> Offsets [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE] or [constant FILL_COUNTER_CLOCKWISE]. diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml index 8f96ab0aed..25e40d4c1f 100644 --- a/doc/classes/Thread.xml +++ b/doc/classes/Thread.xml @@ -7,6 +7,7 @@ A unit of execution in a process. Can run methods on [Object]s simultaneously. The use of synchronization via [Mutex] or [Semaphore] is advised if working with shared objects. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link> </tutorials> <methods> <method name="get_id" qualifiers="const"> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index 04deae6bf5..1ab5c58a30 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -84,6 +84,17 @@ Returns the number of buttons in column [code]column[/code]. May be used to get the most recently added button's index, if no index was specified. </description> </method> + <method name="get_button_tooltip" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="column" type="int"> + </argument> + <argument index="1" name="button_idx" type="int"> + </argument> + <description> + Returns the tooltip string for the button at index [code]button_idx[/code] in column [code]column[/code]. + </description> + </method> <method name="get_cell_mode" qualifiers="const"> <return type="int" enum="TreeItem.TreeCellMode"> </return> diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml index 3e80349b13..9b0c6b2604 100644 --- a/doc/classes/VisualShaderNode.xml +++ b/doc/classes/VisualShaderNode.xml @@ -51,8 +51,11 @@ <constant name="PORT_TYPE_TRANSFORM" value="3" enum="PortType"> Transform type. Translated to [code]mat4[/code] type in shader code. </constant> - <constant name="PORT_TYPE_ICON_COLOR" value="4" enum="PortType"> - Color type. Can be used for return icon type in members dialog (see [method VisualShaderNodeCustom._get_return_icon_type]) - do not use it in other cases! + <constant name="PORT_TYPE_SAMPLER" value="4" enum="PortType"> + Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes. + </constant> + <constant name="PORT_TYPE_MAX" value="5" enum="PortType"> + Represents the size of the [enum PortType] enum. </constant> </constants> </class> diff --git a/doc/classes/X509Certificate.xml b/doc/classes/X509Certificate.xml index 8066f65391..50e9e4e0d4 100644 --- a/doc/classes/X509Certificate.xml +++ b/doc/classes/X509Certificate.xml @@ -5,7 +5,7 @@ </brief_description> <description> The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other [Resource]. - They can be used as the server certificate in [StreamPeerSSL.accept_stream] (along with the proper [CryptoKey]), and to specify the only certificate that should be accepted when connecting to an SSL server via [StreamPeerSSL.connect_to_stream]. + They can be used as the server certificate in [method StreamPeerSSL.accept_stream] (along with the proper [CryptoKey]), and to specify the only certificate that should be accepted when connecting to an SSL server via [method StreamPeerSSL.connect_to_stream]. </description> <tutorials> </tutorials> diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 8eddc35352..1b27e4a35a 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -608,8 +608,10 @@ def rstize_text(text, state): # type: (str, State) -> str break pre_text = text[:pos] + indent_level = 0 while text[pos + 1] == '\t': pos += 1 + indent_level += 1 post_text = text[pos + 1:] # Handle codeblocks @@ -633,6 +635,9 @@ def rstize_text(text, state): # type: (str, State) -> str while code_pos + to_skip + 1 < len(code_text) and code_text[code_pos + to_skip + 1] == '\t': to_skip += 1 + if to_skip > indent_level: + print_error("Four spaces should be used for indentation within [codeblock], file: {}".format(state.current_class), state) + if len(code_text[code_pos + to_skip + 1:]) == 0: code_text = code_text[:code_pos] + "\n" code_pos += 1 |