Skip to content

Commit

Permalink
Add a gdextension online documentation guide. (godotengine#9966)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Oct 8, 2024
1 parent a74060b commit 3ed0339
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tutorials/scripting/gdextension/gdextension_docs_system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,31 @@ Currently they supported tags for the GDExtension documentation system are:
``#ff00ff``, see :ref:`doc_bbcode_in_richtextlabel_hex_colors`).
- ``[color={code/name}]{text}[/color]``


Publishing documentation online
-------------------------------

You may want to publish an online reference for your GDExtension, similar to this website.
The most important step is to build reStructuredText (``.rst``) files from your XML class reference:

.. code-block:: bash
# You need a version.py file, so download it first.
curl -sSLO https://raw.githubusercontent.com/godotengine/godot/refs/heads/master/version.py
# Edit version.py according to your project before proceeding.
# Then, run the rst generator. You'll need to have Python installed for this command to work.
curl -sSL https://raw.githubusercontent.com/godotengine/godot/master/doc/tools/make_rst.py | python3 - -o "docs/classes" -l "en" doc_classes
Your ``.rst`` files will now be available in ``docs/classes/``. From here, you can use
any documentation builder that supports reStructuredText syntax to create a website from them.

`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.

1. Add `godot-docs <https://github.com/godotengine/godot-docs>`_ as a submodule to your ``docs/`` folder.
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``.
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.
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``.

Once you have completed all these steps, your documentation should be available at ``<repo-name>.readthedocs.io``.

0 comments on commit 3ed0339

Please sign in to comment.