Open ardazishvili opened 2 months ago
In case of GDExtension - see https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_docs_system.html
Both GDExtension and module build supported. So there should be a way to mitigate doubling of work
I believe would need to make a doc_classes folder where the XML files would be contained, the files seems to be the same between the 2 build modes. So for the extension, it would need to run the actual godot engine binary to generate the initial stubs files for the classes, afterwards would be basically filling up the information on them, then have to edit the SConstruct to include those files with source=Glob("doc_classes/*.xml"))
.
As for the module side the documentation states that one simply needs to define 2 functions on the config.py file for gathering the folder where the XML files are into (would be the exact same as the GDExtension one) and the actual classes contained on there. This way, accordingly to the docs, the same XML files would be used for both build methods. If made so the xml files are always [ClassName].xml then instead of manually writing down the classes on python, can iterate the directory and get the name without extension of all the XML files, that collection would be the actual class names, so it would automatically update that return result whenever new docs are added.
I also thought it should work like you described, but didn't test it yet. Actually won't test it in nearest future.
If you are interested, doxygen already generates xmls for online documentation. I hope those xmls may be reused for godot, at least with some adaptor/script. Xml files look like this: xml.zip
Same way it is done for all other native classes, e.g. Vector3D or Node3d. Starting point
It worth noting that making documentation is not single issue, but a process. Close this issue when few classes will be documented and there will infrastructure to add new docs.