reference_filling_work.rst 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. .. _doc_reference_filling_work:
  2. Reference filling work
  3. ======================
  4. Godot Engine provides an important number of classes that you can make
  5. use of to create your games. However, the :ref:`toc-class-ref` that
  6. lists all these classes with their methods is quite incomplete. We need
  7. your kind help to fill this reference. This page will explain you how.
  8. > Please note: we aim at filling completely this reference in English
  9. first. Please do not start translating it for the moment.
  10. :ref:`doc_list_of_classes_and_documenters`
  11. Editing with Github
  12. -------------------
  13. Fork Godot Engine
  14. ~~~~~~~~~~~~~~~~~
  15. First of all, you need to fork the Godot Engine on your own GitHub
  16. repository.
  17. You will then need to clone the master branch of Godot Engine in order
  18. to work on the most recent version of the engine, including all of its
  19. features.
  20. ::
  21. git clone https://github.com/your_name/godot.git
  22. Then, create a new git branch that will contain your changes.
  23. ::
  24. git checkout -b reference-edition
  25. The branch you just created is identical to current master branch of
  26. Godot Engine. It already contains a doc/ folder, with the currently
  27. written reference.
  28. Updating the documentation template
  29. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  30. When classes are modified in the source code, the documentation template
  31. might become outdated. To make sure that you are editing an up-to-date
  32. version, you first need to compile Godot (you can follow the
  33. :ref:`doc_introduction_to_the_buildsystem` page), and then run the
  34. following command (assuming 64-bit Linux):
  35. ::
  36. ./bin/godot.x11.tools.64 -doctool doc/base/classes.xml
  37. The doc/base/classes.xml should then be up-to-date with current Godot
  38. Engine features. You can then check what changed (or not) using the
  39. ``git diff`` command. If there are changes to other classes than the one
  40. you are planning to document, please commit those changes first before
  41. starting to edit the template:
  42. ::
  43. git add doc/base/classes.xml
  44. git commit -m "Sync classes reference template with current code base"
  45. You are now ready to edit this file to add stuff.
  46. Push and request a pull of your changes
  47. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. Once your modifications are finished, push your changes on your GitHub
  49. repository:
  50. ::
  51. git add doc/base/classes.xml
  52. git commit -m "Explain your modifications."
  53. git push
  54. When it's done, you can ask for a Pull Request on the GitHub UI of your
  55. Godot fork.
  56. Edit doc/base/classes.xml file
  57. ------------------------------
  58. First of all, check the :ref:`doc_list_of_classes_and_documenters`. Try to work
  59. on classes not already assigned nor filled.
  60. This file is produced by Godot Engine. It is used by the editor, for
  61. example in the Help window (F1, Shift+F1).
  62. You can edit this file using your favourite text editor.
  63. Here is an example with the Node2D class:
  64. ::
  65. Base node for 2D system.
  66. Base node for 2D system. Node2D contains a position, rotation and scale, which is used to position and animate. It can alternatively be used with a custom 2D transform ([Matrix32]). A tree of Node2Ds allows complex hierachies for animation and positioning.
  67. Set the position of the 2d node.
  68. Set the rotation of the 2d node.
  69. Set the scale of the 2d node.
  70. Return the position of the 2D node.
  71. Return the rotation of the 2D node.
  72. Return the scale of the 2D node.
  73. Return the global position of the 2D node.
  74. As you can see, some methods in this class have no description (i.e.
  75. there is no text between their marks). This can also happen for the
  76. description and the brief\_description of the class, but in our case
  77. they are already filled. Let's edit the description of the rotate()
  78. method:
  79. ::
  80. Rotates the node of "degrees" degrees.
  81. That's all!
  82. You simply have to write any missing text between these marks:
  83. -
  84. -
  85. -
  86. Describe clearly and shortly what it does. You can include an example of
  87. use if needed. Avoid grammar faults.
  88. I don't know what this method does!
  89. -----------------------------------
  90. Not a problem. Leave it behind for now, and don't forget to notify the
  91. missing methods when you request a pull of your changes. Another
  92. editor will take care of it.
  93. If you wonder what a method does, you can still have a look at its
  94. implementation in Godot Engine's source code on GitHub. Also, if you
  95. have a doubt, feel free to ask on the
  96. `Forums <http://www.godotengine.org/projects/godot-engine/boards>`__
  97. and on IRC (freenode, #godotengine).