Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up more [b]Example:[/b] lines from the class reference #99020

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

Mickeon
Copy link
Contributor

@Mickeon Mickeon commented Nov 10, 2024

Continuation of #95749, see prior PR for similar reasoning.

This PR continues the effort to standardise the [b]Example:[/b] somewhat, instead of bolding the entire line describing the example below.
It also replaces some lines similar to For example: with [b]Example:[/b]. This is not exhaustive at all, as oftentimes doing this change makes readability worse, but whenever possible... sure, why not?

The descriptions affected by this have received tweaks to justify a localization update. Notably:

  • Control._gui_input() has been changed drastically
  • SyntaxHighlighter.get_line_syntax_highlighting() has been changed drastically
  • A note in HTTPRequest was made into an actual note
  • A note in PopupMenu was shifted to the bottom
  • A note in Window was shifted to the bottom

@Mickeon Mickeon added this to the 4.4 milestone Nov 10, 2024
@Mickeon Mickeon requested a review from a team November 10, 2024 12:40
@Mickeon Mickeon requested review from a team as code owners November 10, 2024 12:40
@Mickeon Mickeon removed request for a team November 10, 2024 12:40
Comment on lines +145 to +151
If the [param event] inherits [InputEventMouse], this method will [b]not[/b] be called when:
- the control's [member mouse_filter] is set to [constant MOUSE_FILTER_IGNORE];
- the control is obstructed by another control on top, that doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE];
- the control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event;
- the control's parent has [member clip_contents] enabled and the [param event]'s position is outside the parent's rectangle;
- the [param event]'s position is outside the control (see [method _has_point]).
[b]Note:[/b] The [param event]'s position is relative to this control's origin.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly happy about this, still, but changing it too much would be way out of scope.

@@ -22,7 +22,7 @@
AddChild(scene);
[/csharp]
[/codeblocks]
[b]Example of saving a node with different owners:[/b] The following example creates 3 objects: [Node2D] ([code]node[/code]), [RigidBody2D] ([code]body[/code]) and [CollisionObject2D] ([code]collision[/code]). [code]collision[/code] is a child of [code]body[/code] which is a child of [code]node[/code]. Only [code]body[/code] is owned by [code]node[/code] and [method pack] will therefore only save those two nodes, but not [code]collision[/code].
[b]Example:[/b] Save a node with different owners. The following example creates 3 objects: [Node2D] ([code]node[/code]), [RigidBody2D] ([code]body[/code]) and [CollisionObject2D] ([code]collision[/code]). [code]collision[/code] is a child of [code]body[/code] which is a child of [code]node[/code]. Only [code]body[/code] is owned by [code]node[/code] and [method pack] will therefore only save those two nodes, but not [code]collision[/code].
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire line is downright awful, but changing it now would be way out of scope. There's a lot to... unpack here.

@@ -102,7 +102,7 @@
<param index="0" name="name" type="StringName" />
<description>
Similar to [method get_setting], but applies feature tag overrides if any exists and is valid.
[b]Example:[/b] If the setting override [code]"application/config/name.windows"[/code] exists, and the following code is executed on a [i]Windows[/i] operating system, the overridden setting is printed instead:
[b]Example:[/b] If the setting override [code]"application/config/name.windows"[/code] exists, and the following code is executed on a [i]Windows[/i] operating system, the overridden setting is printed instead:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

Copy link
Member

@mhilbrunner mhilbrunner Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to replace U+0009 Character Tabulation with U+0020 Space, which is correct. No idea how that tab got there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was the one that modified this line, but that tab shouldn't be allowed in the first place. @Repiteo mentioned he wanted to take a look at preventing this in the future.
Because I didn't check for tabs there may be more like this.
And indeed there are tabs here.
image

@Mickeon Mickeon force-pushed the documentation-example-pruning-2 branch from eff5d28 to 1b99030 Compare November 10, 2024 12:46
@Mickeon Mickeon requested a review from a team as a code owner November 10, 2024 12:46
@Mickeon Mickeon force-pushed the documentation-example-pruning-2 branch 2 times, most recently from 4292da5 to 99da18d Compare November 10, 2024 14:21
@Mickeon Mickeon removed the request for review from a team November 10, 2024 14:32
@@ -80,7 +80,7 @@
}
[/csharp]
[/codeblocks]
[b]Example of loading and displaying an image using HTTPRequest:[/b]
[b]Example:[/b] Load and display an image using [HTTPRequest]:
Copy link
Member

@mhilbrunner mhilbrunner Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Example: Load an image using [HTTPRequest] and display it" would be more correct, but more cumbersome, so... whatever, let's probably leave as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that seems appropriate to me. I can change it.

@Mickeon Mickeon force-pushed the documentation-example-pruning-2 branch from 99da18d to db385eb Compare November 11, 2024 11:02
@Mickeon Mickeon force-pushed the documentation-example-pruning-2 branch from db385eb to 932b1c4 Compare November 11, 2024 11:05
@Repiteo Repiteo merged commit 2c31bd7 into godotengine:master Nov 12, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 12, 2024

Thanks!

@Mickeon Mickeon deleted the documentation-example-pruning-2 branch November 12, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants