Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

Contribuyendo a la referencia de la clase

The Class reference is a set of articles describing the public API of the engine. This includes descriptions for various classes, methods, properties, and global objects, available for scripting. The class reference is available online, from the documentation sidebar, and in the Godot editor, from the help menu.

As the engine grows and features are added or modified, some parts of the class reference become obsolete and new descriptions and examples need to be added. While developers are encouraged to document all of their work in the class reference when submitting a pull request, we can't expect everyone to be able to write high quality documentation, so there is always work for contributors like you to polish existing and create missing reference material.

El código fuente de la referencia de clases

As the class reference is available in two places, online and in the editor, we need to take care to keep things in sync. To achieve this the main Godot repository is picked as the source of truth, and the documentation for the class reference is tracked there.

Advertencia

No debes editar los archivos .rst en la carpeta classes/ del ``repositorio de documentación <https://github.com/godotengine/godot-docs/>`_. Estos archivos se generan automáticamente y los mantenedores del proyecto los sincronizan manualmente. Sigue leyendo para aprender cómo editar correctamente la referencia de clase.

In the main repository the class reference is stored in XML files, one for each exposed class or global object. The majority of these files is located in doc/classes/, but some modules contain their own documentation as well. You will find it in the modules/<module_name>/doc_classes/ directory. To learn more about editing XML files refer to Guías de referencia de clases.

Ver también

Para obtener más detalles sobre el uso de Git y el flujo de solicitud de extracción (pull request), consulta la página Flujo de trabajo para los Pull request.

Si deseas traducir la referencia de clases del inglés a otro idioma, consulta Editor and documentation localization. Esta guía también está disponible como video tutorial en YouTube.

Importante: Si planeas realizar cambios importantes, debes crear un problema (issue) en el repositorio godot-docs o comentar en un problema existente. De esta manera, otros sabrán que ya estás trabajando en una clase específica.

What to contribute

The natural place to start contributing is the classes that you are most familiar with. This ensures that the added description will be based on experience and the necessary know-how, not just the name of a method or a property. We advise not to add low effort descriptions, no matter how appealing it may look. Such descriptions obscure the need for documentation and are hard to identify automatically.

Ver también

Seguir este principio es importante y nos permite crear herramientas para los contribuyentes. Como la herramienta de seguimiento del estado de compleción de la referencia de clases. Puedes usarla para encontrar rápidamente páginas de documentación a las que les faltan descripciones.

If you decide to document a class, but don't know what a particular method does, don't worry. Leave it for now, and list the methods you skipped when you open a pull request with your changes. Another writer will take care of it.

You can still look at the methods' implementation in Godot's source code on GitHub. If you have doubts, feel free to ask on the Q&A website and Godot Contributors Chat.

Advertencia

A menos que realices cambios menores, como corregir un error tipográfico, no recomendamos utilizar el editor web de GitHub para editar el XML de la referencia de clases. Este carece de funciones para editar bien XML, como mantener consistentes las sangrías, y no permite modificar commits basados en revisiones.

It also doesn't allow you to test your changes in the engine or with validation scripts as described in Cómo editar una clase XML.

Actualizando la referencia de clases cuando se trabaja en el motor

When you create a new class or modify an existing engine's API, you need to re-generate the XML files in doc/classes/.

To do so, you first need to compile Godot. See the Introducción al sistema de compilación page to learn how. Then, execute the compiled Godot binary from the Godot root directory with the --doctool option. For example, if you're on 64-bit Linux, the command might be:

./bin/godot.linuxbsd.editor.x86_64 --doctool

El conjunto exacto de sufijos puede ser diferente. Lee atentamente el artículo vinculado para obtener más información al respecto.

Los archivos XML en doc/classes/ deberían estar actualizados con las características actuales de Godot Engine. Puedes verificar que fue modificado utilizando el comando git diff.

Incluye únicamente cambios que sean relevantes para tu trabajo en la API en tus commits. Puedes descartar cambios en otros archivos XML usando git checkout, pero considera informar si notas que se actualizan archivos no relacionados. Idealmente, al ejecutar este comando solo deberían aparecer los cambios que hayas realizado.