Logo
latest

Getting started

  • Introduction
    • Overview
    • Requirements
  • Installation
    • Python
    • Pip
    • Virtual environments
    • Godot
    • Script files
      • For extracting information from Godot
      • For creating the .rst files
      • Downloading the files
        • With git
        • Without git
    • gdscript2rest
    • godot-api-refs
    • Sphinx
    • Sphinx extensions
      • sphinx-rtd-theme
      • sphinx-notfound-page
      • sphinx-tabs
  • API Creation
    • Comment Godot script files
      • Enabling a script file for Commenting
      • Format of comments
      • What can be documented?
      • What isn't documented
      • Example Script file
      • Example reStructuredText file
    • Linking user docs to Godot help files
    • Automatic method
    • Manual method
      • Create the reference.json file
        • 1. From within the Godot editor
        • 2. From the command line
      • Generate the API reStructuredText files
  • Document Project Setup
    • Create project root and virtual environment
    • Setting Up Sphinx Environment
      • Install Sphinx
      • Install additional modules
    • Setting Up the Project Structure
    • Choosing an IDE
      • Setting Up VSCode
        • Install VSCode
        • Install Extensions
    • No preview showing
    • Configuring Sphinx
      • Setting up conf.py
        • Basic changes
        • Additional enhancements
        • Advanced options
    • Add gdscript2rst scripts
  • Creating the project documentation
    • Setting up the documentation folder
    • Creating the Sample Godot Project
    • Build Initial Documentation
    • Next steps
      • Further refinements
  • Afterword
  • Appendices
    • Appendix A - Sphinx conf.py file
    • Appendix B - custom css file
gdscript2rst
  • »
  • API Creation »
  • Creating Godot API hyperlinks
  • Edit on GitHub

Creating Godot API hyperlinks

Whichever method is chosen to create the reStructuredText files a prerequisite is that a file called godot_api_call.json has to be available. This file is a list of all the Godot APIs with its associated hyperlink to the relevant Godot help page. This enables the automatic creation of Godot help file links within the users final documentation.

The utility godot_api_ref will create this file for you. The following shows the usage and the options available.

usage: python -m godot_api_ref [options]

Given a godot-docs branch it scans the class folder and creates a JSON file
linking the Godot class name with the API reference

options:
   -h, --help        show this help message and exit
   --token TOKEN     optional github access token
                     (default "" may only gives 60 reads/hour)
   --branch BRANCH   optional branch for the class files (default: stable)
   -v, --verbose     Set the verbosity level. For example -vv sets
                     verbosity to level 2. Default: 0.
   --check-branches  print out a list of the Godot document branches
                     then exit without making the links

Running $ python -m godot_api_ref will create a godot_api_calls.json file with links to the stable versions documentation at the time of creation.

For those with projects created by earlier versions of Godot the program can be invoked with the --branch option e.g. $ python -m godot_api_ref --branch 3.2 will create the godot_api_calls.json file with links to the version 3.2 documentation.

Invoking with $ python -m godot_api_ref --check-branches will display a list of available document versions for creating the godot_api_calls.json file.

Previous Next

© Copyright 2022, Douglas Webster. Revision 422a7e3f.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions
latest
Downloads
On Read the Docs
Project Home
Builds