Skip to content

Commit 34b6e5e

Browse files
IvorforceCalinoupaddy-exe
authored andcommitted
Add a gdextension online documentation guide. (godotengine#9966)
* Add a gdextension online documentation guide. --------- Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro> Co-authored-by: Patrick Exner (FlameLizard) <patrick.exner1@web.de>
1 parent 8a751a5 commit 34b6e5e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tutorials/scripting/gdextension/gdextension_docs_system.rst

+28
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,31 @@ Currently they supported tags for the GDExtension documentation system are:
170170
``#ff00ff``, see :ref:`doc_bbcode_in_richtextlabel_hex_colors`).
171171
172172
- ``[color={code/name}]{text}[/color]``
173+
174+
175+
Publishing documentation online
176+
-------------------------------
177+
178+
You may want to publish an online reference for your GDExtension, similar to this website.
179+
The most important step is to build reStructuredText (``.rst``) files from your XML class reference:
180+
181+
.. code-block:: bash
182+
183+
# You need a version.py file, so download it first.
184+
curl -sSLO https://raw.githubusercontent.com/godotengine/godot/refs/heads/master/version.py
185+
186+
# Edit version.py according to your project before proceeding.
187+
# Then, run the rst generator. You'll need to have Python installed for this command to work.
188+
curl -sSL https://raw.githubusercontent.com/godotengine/godot/master/doc/tools/make_rst.py | python3 - -o "docs/classes" -l "en" doc_classes
189+
190+
Your ``.rst`` files will now be available in ``docs/classes/``. From here, you can use
191+
any documentation builder that supports reStructuredText syntax to create a website from them.
192+
193+
`godot-docs <https://github.com/godotengine/godot-docs>`_ uses `Sphinx <https://www.sphinx-doc.org/en/master/>`_. You can use the repository as a basis to build your own documentation system. The following guide describes the basic steps, but they are not exhaustive: You will need a bit of personal insight to make it work.
194+
195+
1. Add `godot-docs <https://github.com/godotengine/godot-docs>`_ as a submodule to your ``docs/`` folder.
196+
2. Copy over its ``conf.py``, ``index.rst``, ``.readthedocs.yaml`` files into ``/docs/``. You may later decide to copy over and edit more of godot-docs' files, like ``_templates/layout.html``.
197+
3. Modify these files according to your project. This mostly involves adjusting paths to point to the ``godot-docs`` subfolder, as well as strings to reflect it's your project rather than Godot you're building the docs for.
198+
4. Create an account on `readthedocs.org <http://readthedocs.org>`_. Import your project, and modify its base ``.readthedocs.yaml`` file path to ``/docs/.readthedocs.yaml``.
199+
200+
Once you have completed all these steps, your documentation should be available at ``<repo-name>.readthedocs.io``.

0 commit comments

Comments
 (0)