You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux Kubuntu 23.04 KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.104.0 Qt Version: 5.15.8
Issue description
Adding tooltips to @export variables does not support many bbcodes.
Steps to reproduce
Create an empty 2D scene. E.g. Control
Add an external script to it. E.g. control.gd
Add the following to script and save:
extendsControl## [p]Hello[/p]Notice no paragraph.## [bgcolor=RED]Should be background red.[/bgcolor][br][i][color=green]THIS IS ITALIC AND GREEN.[/color][/i]## [br]Click for more info url works [url=https://yahoo.com]https://yahoo.com[/url]## [p][right]This is a paragraph but did not break[/right]## [br][font_size=30]Should be 10[/font] font## [br]Strangely enough the [ br ] acts as [br] paragraph, although not documented.@exportvarmaximum_speed:int=100
Now hover over the exported variable maximum_speed, in the inspector. You will see that only some of the bbcodes work. For example[p], [bgcolor], [right]are ignored and shown as text. As a matter of fact I have discovered an undocumented [br] break in lieu of [p] paragraph code.
Godot's class reference supports BBCode-like tags. They add nice formatting to the text which could also be used in the documentation. See also class reference bbcode. Note that this is slightly different from the RichTextLabel BBCode.
In the future, we could unify the RichTextLabel BBCode / Editor Help tags parser, since there is code duplication.
Note that it might not be worth supporting all BBCode tags in documentation, as they can encourage non-standard theming that can be difficult to read on some backgrounds ([color]).
Instead, the use of a standard syntax including admonitions should be encouraged as much as possible. This would also help third-party docs feel more like built-in documentation, leading to better integration of add-ons.
I agree, some of the codes may not be suitable for tooltips. I did not realize there was an alternate document for describing these, as I was just using the RichTextLabel bbcode documentation. The paragraph mentioning alternate usages is not obvious in https://docs.godotengine.org/en/stable/tutorials/ui/bbcode_in_richtextlabel.html
Maybe a See Also blue box highlighting or enhancing that paragraph would suffice.
Something like
Note that the BBCode tags can also be used to some extent in tooltips for @export script variables as well as in the XML source of the class reference. For more information, see Class reference primer.
Tested versions
v4.3.beta2.official [b75f048]
System information
Linux Kubuntu 23.04 KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.104.0 Qt Version: 5.15.8
Issue description
Adding tooltips to @export variables does not support many bbcodes.
Steps to reproduce
Create an empty 2D scene. E.g.
Control
Add an external script to it. E.g.
control.gd
Add the following to script and save:
Now hover over the exported variable
maximum_speed
, in the inspector. You will see that only some of the bbcodes work. For example[p], [bgcolor], [right]
are ignored and shown as text. As a matter of fact I have discovered an undocumented[br]
break in lieu of[p]
paragraph code.Minimal reproduction project (MRP)
Test project Archive.zip
The text was updated successfully, but these errors were encountered: