updating_the_class_reference.rst 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. .. _doc_updating_the_class_reference:
  2. Contributing to the class reference
  3. ===================================
  4. .. highlight:: shell
  5. The class reference is available online in the :ref:`classes <toc-class-ref>`
  6. section of the documentation and in the Godot editor, from the help menu.
  7. In the class reference, some methods, variables, and signals lack descriptions.
  8. Others changed with recent releases and need updates. The developers can't write
  9. the entire reference on their own. Godot needs you, and all of us, to
  10. contribute.
  11. **Important:** If you plan to make large changes, you should create an issue on
  12. the `godot-docs repository <https://github.com/godotengine/godot-docs/>`_
  13. or comment on an existing issue. Doing so lets others know you're already
  14. taking care of a given class.
  15. .. seealso::
  16. You can find the writing guidelines for the class reference :ref:`here <doc_class_reference_writing_guidelines>`.
  17. For details on Git usage and the pull request workflow, please
  18. refer to the :ref:`doc_pr_workflow` page.
  19. If you want to translate the class reference from English to another
  20. language, see :ref:`doc_editor_and_docs_localization`.
  21. This guide is also available as a `video tutorial on YouTube
  22. <https://www.youtube.com/watch?v=5jeHXxeX-JY>`_.
  23. .. seealso::
  24. Not sure which class to contribute to? Take a look at the class reference's
  25. completion status `here <https://godotengine.github.io/doc-status/>`_.
  26. You can find the source files for the class reference in Godot's GitHub
  27. repository: `doc/classes/
  28. <https://github.com/godotengine/godot/tree/master/doc/classes>`_.
  29. .. note:: For some modules in the engine's source code, you'll find the XML
  30. files in the ``modules/<module_name>/doc_classes/`` directory instead.
  31. .. warning:: Always edit the API reference through these source XML files. Do
  32. not edit the generated ``.rst`` files :ref:`in the online documentation
  33. <toc-class-ref>`, hosted in the `godot-docs
  34. <https://github.com/godotengine/godot-docs>`_ repository.
  35. .. warning::
  36. Unless you make minor changes, like fixing a typo, we do not recommend using the GitHub web editor to edit the class reference's XML.
  37. It lacks features to edit XML well, like keeping indentations consistent, and it does not allow amending commits based on reviews.
  38. Also, it doesn't allow you to test your changes in the engine or with validation
  39. scripts as described in
  40. :ref:`doc_class_reference_writing_guidelines_editing_xml`.
  41. Updating the documentation template
  42. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  43. When you create a new class or modify the engine's API, you need to re-generate the XML files in ``doc/classes/``.
  44. To do so, you first need to compile Godot. See the
  45. :ref:`doc_introduction_to_the_buildsystem` page to learn how. Then, execute the
  46. compiled Godot binary from the Godot root directory with the ``--doctool`` option.
  47. For example, if you're on 64-bit Linux, the command is::
  48. ./bin/godot.linuxbsd.tools.64 --doctool
  49. The XML files in doc/classes should then be up-to-date with current Godot Engine
  50. features. You can then check what changed using the ``git diff`` command. Please
  51. only include changes that are relevant to your work on the API in your commits.
  52. You can discard changes in other XML files using ``git checkout``.