Godot ships with many nodes and singletons to help you develop your games in GDscript. Each is a class, documented in the class reference. This reference is essential for anyone learning the engine: it is available both online and in the engine.

But it’s incomplete. Some methods, variables and signals lack descriptions. Others changed with recent releases and need updates. The developers can’t write the entire reference on their own. Godot needs you, and all of us, to contribute.

Important: If you are planning to make larger changes or a more substantial contribution, it is usually a good idea
to create an issue (or a comment in an existing one) to let others know so they don’t start working on the same thing too.

Other writers contribute to Godot’s documentation. Your local repository will fall behind it, and you’ll have to synchronize it. Especially if other contributors update the class reference while you work on it.

First add an upstream git remote to work with. Remotes are links to online repositories you can download new files from.

gitremoteaddupstreamhttps://github.com/godotengine/godot

You can check the list of all remote servers with:

gitremote-v

You should have two: origin, your fork on github, that git adds by default, and upstream, that you just added:

When classes are modified in the source code, the documentation template might become outdated. To make sure that you are editing an up-to-date version, you first need to compile Godot (you can follow the Introduction to the buildsystem page), and then run the following command (assuming 64-bit Linux):

./bin/godot.x11.tools.64--doctool.

The xml files in doc/classes should then be up-to-date with current Godot Engine features. You can then check what changed using the gitdiff command. If there are changes to other classes than the one you are planning to document, please commit those changes first before starting to edit the template:

When it’s done, you can ask for a Pull Request via the GitHub UI of your Godot fork.

Warning

Although you can edit files on GitHub, it’s not recommended. As hundreds of contributors work on Godot, the git history must stay clean. Each commit should bundle all related improvements you make to the class reference, a new feature, bug fixes… When you edit from GitHub, it will create a new branch and a Pull Request every time you want to save it. If a few days pass before your changes get a review, you won’t be able to update to the latest version of the repository cleanly. Also, it’s harder to keep clean indents from GitHub. And they’re very important in the docs.

TL;DR: If you don’t know what you’re doing exactly, do not edit files from GitHub.

Edit the file for your chosen class in doc/classes/ to update the class reference. The folder contains an XML file for each class. The XML lists the constants and methods you’ll find in the class reference. Godot generates and updates the XML automatically.

Edit it using your favourite text editor. If you use a code editor, make sure that it doesn’t change the indent style: tabs for the XML, and 4 spaces inside BBcode-style blocks. More on that below.

Each class has a brief and a long description. The brief description is always at the top of the page, while the full description lies below the list of methods, variables and constants. Methods, member variables, constants and signals are in separate categories or XML nodes. For each, learn how they work in Godot’s source code, and fill their <description>.

Our job is to add the missing text between these marks:

<description></description>

<brief_description></brief_description>

<constant></constant>

<method></method>

<member></member>

<signal></signal>

Write in a clear and simple language. Always follow the writing guidelines to keep your descriptions short and easy to read. Do not leave empty lines in the descriptions: each line in the XML file will result in a new paragraph.