This guide explains how to contribute to Godot's documentation, be it by writing or reviewing pages.
If you want to translate pages or the class reference from English to other languages, read 本地化編輯器與說明文件.
To modify or create pages in the reference manual, you need to edit
files in the godot-docs GitHub repository. Modifying those pages in a pull
request triggers a rebuild of the online documentation upon merging.
有關詳細的 Git 使用方法與 PR 工作流程，請參考 Pull Request 工作流程 一頁。該頁面中大部分關於 godotengine/godot 儲存庫的說明也適用於這個說明文件的儲存庫。
What is the Godot documentation¶
The Godot documentation is intended as a comprehensive reference manual for the Godot game engine. It is not meant to contain step-by-step tutorials, except for two game creation tutorials in the Getting Started section.
We strive to write factual content in an accessible and well-written language. To contribute, you should also read:
The 說明文件撰寫方針. There, you will find rules and recommendations to write in a way that everyone understands.
The content guidelines. They explain the principles we follow to write the documentation and the kind of content we accept.
Pull Requests should use the
master branch by default. Only make Pull
Requests against other branches (e.g.
3.0) if your changes only
apply to that specific version of Godot.
Though less convenient to edit than a wiki, this Git repository is where we write the documentation. Having direct access to the source files in a revision control system is a plus to ensure our documentation quality.
Editing existing pages¶
To edit an existing page, locate its
.rst source file and open it in your
favorite text editor. You can then commit the changes, push them to your fork,
and make a pull request. Note that the pages in
classes/ should not be
edited here. They are automatically generated from Godot’s XML class
See 參與貢獻類別參照文件 for details.
To build the manual and test changes on your computer, see Building the manual with Sphinx.
Editing pages online¶
You can edit the documentation online by clicking the Edit on GitHub link in the top-right of every page.
Doing so takes you to the GitHub text editor. You need to have a GitHub account and to log in to use it. Once logged in, you can propose change like so:
點擊 Edit on GitHub 按鈕。
On the GitHub page you're taken to, click the pencil icon in the top-right corner near the Raw, Blame, and Delete buttons. It has the tooltip "Fork this project and edit the file".
Edit the text in the text editor.
At the bottom of the web page, summarize the changes you made and click the button Propose file change. Make sure to replace the placeholder "Update file.rst" by a short but clear one-line description, as this is the commit title.
On the following screens, click the Create pull request button until you see a message like Username wants to merge 1 commit into godotengine:master from Username:patch-1.
Another contributor will review your changes and merge them into the docs if they're good. They may also make changes or ask you to do so before merging.
Adding new pages¶
Before adding a new page, please ensure that it fits in the documentation:
Look for existing issues or open a new one to see if the page is necessary.
Ensure there isn't a page that already covers the topic.
Read our Content guidelines.
To add a new page, create a
.rst file with a meaningful name in the section you
want to add a file to, e.g.
You should then add your page to the relevant "toctree" (table of contents,
tutorials/3d/index.rst). Add your new filename to the list on a new
line, using a relative path and no extension, e.g. here
頁面應以頁面標題與 Sphinx 參照名稱開頭：
.. _doc_insert_your_title_here: Insert your title here ======================
_doc_insert_your_title_here and the title should match.
:ref:`doc_insert_your_title_here` 會連結到上述範例頁面 (請注意參照中沒有最前面的底線)。
Write your titles like plain sentences, without capitalizing each word:
Good: Understanding signals in Godot
Bad: Understanding Signals In Godot
Only propers nouns, projects, people, and node class names should have their first letter capitalized.
Sphinx and reStructuredText syntax¶
Sphinx uses specific reST comments to do specific operations, like defining the
table of contents (
.. toctree::) or cross-referencing pages. Check the
official Sphinx documentation for more details. To learn
how to use Sphinx directives like
.. note:: or
.. seealso::, check out
the Sphinx directives documentation.
Adding images and attachments¶
To add images, please put them in an
img/ folder next to the
.rst file with
a meaningful name and include them in your page with:
.. image:: img/image_name.png
Similarly, you can include attachments, like assets as support material for a
tutorial, by placing them into a
files/ folder next to the
.rst file, and
using this inline markup:
這份文件以及其包含的所有頁面都是以創用 CC—姓名標示 (CC-BY 3.0) 發表，作者請標示「Juan Linietsky, Ariel Manzur and the Godot community」。
一旦於該 GitHub 儲存庫中參與貢獻說明文件，你便同意以該授權條款發佈你所做出的修改。