How to get the Engine Help document description by GDscript?

Godot Version 4.2

Question How to get the Engine Help document description by GDscript?

I want to make a more special view for gdscript Help document , and add some other interesting function. but i can’t find the function to get class descripted text from Engine by GDscript.

One simple Method is download the Help documet and get it independently. But this way most update the document by hand when new version and maybe will make some misunterstanding. So i want to know is there such a fuction or class can realize this ? thanks for milo-o.fun

Hi!

To be clear, are you talking about the in-editor class reference for the built-in API (e.g. Node2D, AnimationPlayer, etc.), or the generated GDScript documentation for your own scripts?

Either way, neither are exposed to the scripting API currently, so it’s not possible to access this data from GDScript. From a C++ module, the class reference data can be accessed via EditorHelp::get_doc_data(), and the GDScript script documentation can be access via script->get_documentation (where script is a GDScript *).

This could theoretically be exposed but that would mean exposing a lot of the underlying data types, significantly increasing the maintenance and compatibility keeping burden on this interface. So it really depends on how much demand there is for such functionality.

Thank you for your clear reply !
I want to get the in-Editor frist, which is more basic has higher influence.

Since I am a beginner in godot and C++ is not great, I would prefer to use GDscript to implement my initial ideas (if there is an official API plan in the future), and of course I will try to use the C++ module.

Yes, in fact I’m also curious about this part, how godot is implemented and whether it has a lot of data structures and classes. However, the opening of similar APIs is not only conducive to the customization of the editor, but also more convenient for the reprocessing of the help text, including not limited to localization, extension and improvement. Especially for non-English users, to facilitate better learning.

Maybe you could give some more details about what you want to do exactly?

If you’re trying to localize the class reference, be aware that it’s already supported in the engine. Only Simplified and Traditional Chinese are close to 100% complete currently, but other languages can be contributed to: Godot Engine/Godot Class Reference @ Hosted Weblate

If feel like if you’re trying to parse the class reference text in the editor to be able to localize it client-side, you’re starting on a very complex journey to reimplement something that we already support :slight_smile:

Well, it seems I’m complicating matters.

I actually wanted to create a Chinese visualization for the editor (with some interesting pictograms of Chinese characters linked to programming concepts that you can simply understand as ICONS), It’s not just about identifiers, but also keyworks.(I have made some progress in this area and will share with you if I succeed in the future)
But this made a big difference when looking up the help documentation, so I wanted to add some of the documentation to get a better understanding of it. So ultimately it comes down to processing the help text.
As you say, I don’t wang to do repetitive work too, so i need to know more about how to get the text
efficiently and compatibly.Of course, this is just a hiccup, but eventually I want to get back to my Edit plugin development and learning.

This could theoretically be exposed but that would mean exposing a lot of the underlying data types, significantly increasing the maintenance and compatibility keeping burden on this interface. So it really depends on how much demand there is for such functionality.

I think something like script.get_documentation_description in GDScript that simply returns a String can be very useful. For example plugins using custom UI to add nodes to the scene can benefit from using their doc description as tooltip, so you don’t have to set it manually and/or have to maintain two instances of the description (tooltip text and doc string).

A~Ah, it seem i have found an easier way to get the help document ! Using the EditorDebugger , i know what is GodotEditor doing. then search the CodeEdit area and the works, we can find the node in the tree , them we can get_node( ) or node.get_child( )… to find the node and the text member property which i want the help text .
then processing the text and show with my designed Editor.

Perhaps editor help data can be exposed in some limited way? We need it to show tooltips about custom classes in our plugin. Currently, porting it to GDExtension and looking for a way to show that tooltip.

Yeah I’m starting to think that there can be value in exposing the editor help data somehow.

Not sure how exactly, which parts of its API are needed and for what use cases. But it does seem potentially useful for custom plugins indeed.

1 Like