Skip to content

Commit 1255442

Browse files
committed
Add details about generating XML files from documentation comments
1 parent 5ebc3a7 commit 1255442

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

tutorials/scripting/gdscript/gdscript_documentation_comments.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ members of a script. There are two differences between a normal comment and a do
88
comment. Firstly, a documentation comment should start with double hash symbols
99
``##``. Secondly, it must immediately precede a script member, or for script descriptions,
1010
be placed at the top of the script. If an exported variable is documented,
11-
its description is used as a tooltip in the editor. This documentation can be
12-
generated as XML files by the editor.
11+
its description is used as a tooltip in the editor. The editor can also export XML files
12+
of this documentation, see `Generating XML files`_ for details on this.
1313

1414
Documenting a script
1515
--------------------
@@ -355,3 +355,22 @@ the ``lang`` attribute. Currently supported options are:
355355
- ``[codeblock lang=text]`` disables syntax highlighting;
356356
- ``[codeblock lang=gdscript]`` highlights GDScript syntax;
357357
- ``[codeblock lang=csharp]`` highlights C# syntax (only in .NET version).
358+
359+
Generating XML files
360+
--------------------
361+
362+
The editor can generate XML files from your documentation comments, which can be useful to create
363+
an online documentation. To generate the XML files, you can execute the following command from your
364+
project's root folder:
365+
366+
::
367+
368+
godot --doctool <destination> --gdscript-docs <path>
369+
370+
The XML files will be generated in the ``<destination>`` folder, or ``docs`` if omitted.
371+
The target ``<path>`` specifies which scripts will be included, and Godot will recursively generate
372+
XML files for all scripts in this folder and all subfolders.
373+
374+
.. warning::
375+
376+
``<path>`` must start with ``res://``, otherwise Godot will not be able to find scripts!

0 commit comments

Comments
 (0)