IINinja / gdscript-docs-maker

Create documentation and class references from your Godot GDScript code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GDScript Docs Maker

Docs Maker is a set of tools to parse Godot GDScript code, output a code reference or documentation as JSON, merge json files together, and convert the JSON data to markdown.

The program is still a work-in-progress.

Generating a code reference as JSON

To generate code references, we rely on the GDScript language server in Godot 3.2+. This involves running an EditorScript from your Godot project.

For more information and detailed instructions, see /godot-scripts.

Converting JSON

Call the gdscript-docs-maker package directly using the python -m option:

python -m gdscript-docs-maker files [files ...]

The program takes a list of JSON files. For example, we generate the code reference of our AI framework Godot Steering Toolkit like so with the shell:

python -m gdscript-docs-maker ~/Repositories/godot-steering-toolkit/src/reference.json

Writing your code reference

Document properties and functions with comment blocks placed on the line before their definition:

# A linear and angular amount of acceleration.
class_name GSTTargetAcceleration


# Linear acceleration
var linear: = Vector3.ZERO
# Angular acceleration
var angular: = 0.0


# Resets the accelerations to zero
func reset() -> void:
	linear = Vector3.ZERO
	angular = 0.0

Your docstrings can be as long as you want.

About

Create documentation and class references from your Godot GDScript code

License:MIT License


Languages

Language:Python 71.2%Language:GDScript 28.8%