All Projects → GDQuest → Gdscript Docs Maker

GDQuest / Gdscript Docs Maker

Licence: mit
Create documentation and class references from your Godot GDScript code

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Gdscript Docs Maker

Wazuh Documentation
Wazuh - Project documentation
Stars: ✭ 82 (-32.23%)
Mutual labels:  documentation, reference
Jekyll Rtd Theme
Just another documentation theme compatible with GitHub Pages
Stars: ✭ 92 (-23.97%)
Mutual labels:  documentation, documentation-tool
Godot3 procgen demos
Exploring Procedural Generation algorithms in Godot
Stars: ✭ 85 (-29.75%)
Mutual labels:  godot, godot-engine
Godotrogueliketutorial
A guide to build a simple Roguelike game with Godot engine.
Stars: ✭ 117 (-3.31%)
Mutual labels:  godot, godot-engine
Lurker
📖 The ultimate tool for documenting and testing APIs in Rails
Stars: ✭ 120 (-0.83%)
Mutual labels:  documentation, documentation-tool
Godot Demos
Dozens of free and open source demos for the Godot game engine
Stars: ✭ 1,231 (+917.36%)
Mutual labels:  godot, godot-engine
Docpht
With DocPHT you can take notes and quickly document anything and without the use of any database.
Stars: ✭ 90 (-25.62%)
Mutual labels:  documentation, documentation-tool
Zeal
Offline documentation browser inspired by Dash
Stars: ✭ 9,164 (+7473.55%)
Mutual labels:  documentation, documentation-tool
Pasdoc
Documentation tool for ObjectPascal (Free Pascal, Lazarus, Delphi) source code
Stars: ✭ 110 (-9.09%)
Mutual labels:  documentation, documentation-tool
Pyspark Cheatsheet
🐍 Quick reference guide to common patterns & functions in PySpark.
Stars: ✭ 108 (-10.74%)
Mutual labels:  documentation, reference
Graphdoc
Static page generator for documenting GraphQL Schema
Stars: ✭ 1,218 (+906.61%)
Mutual labels:  documentation, documentation-tool
Gamedev4noobs
Olá, sejam bem-vindos ao repositório _gamedev4noobs_ do Estúdio Vaca Roxa. O propósito desse repositório, além de contribuir para o projeto 4noobs, é ensinar o básico do desenvolvimento de jogos para iniciantes. Apresentando boas práticas e insumos para criar games incríveis.
Stars: ✭ 122 (+0.83%)
Mutual labels:  godot, godot-engine
Qurobullet
A powerful 2D projectile system module for Godot!
Stars: ✭ 78 (-35.54%)
Mutual labels:  godot, godot-engine
Drf Autodocs
Ultimately automated DRF documentation rendering(UNMAINTAINED)
Stars: ✭ 82 (-32.23%)
Mutual labels:  documentation, documentation-tool
Jsdoc To Markdown
Generate markdown documentation from jsdoc-annotated javascript
Stars: ✭ 1,199 (+890.91%)
Mutual labels:  documentation, documentation-tool
Community
Modern Confluence alternative designed for internal & external docs, built with Golang + EmberJS
Stars: ✭ 1,286 (+962.81%)
Mutual labels:  documentation, documentation-tool
Peach
Peach is a web server for multi-language, real-time synchronization and searchable documentation.
Stars: ✭ 1,166 (+863.64%)
Mutual labels:  documentation, documentation-tool
Grav Skeleton Rtfm Site
Grav RTFM Skeleton
Stars: ✭ 74 (-38.84%)
Mutual labels:  documentation, documentation-tool
Naturaldocs
Natural Docs source code documentation system
Stars: ✭ 106 (-12.4%)
Mutual labels:  documentation, documentation-tool
Catalog
Create living style guides using Markdown or React
Stars: ✭ 1,527 (+1161.98%)
Mutual labels:  documentation, documentation-tool

GDScript Docs Maker

Project banner

Docs Maker is a set of tools to convert documentation you write inside your code to an online or offline code reference in the markdown format.

If you make plugins or a framework for Godot, GDScript Docs Maker will help you save a lot of time documenting your code.

It creates documents following Godot's built-in class reference. You can see an example with our Godot Steering Toolkit documentation

Table of Contents

Note: This program requires Godot 3.2+ and Python 3.7+ to work.

Installing

You can install the GDScript Docs Maker python package with pip:

# On Linux and MacOS:
python3 -m pip install gdscript_docs_maker

# On Windows, if you installed Python 3.7+, you can use:
python -m pip install gdscript_docs_maker

Although to use the shell script that simplifies creating the reference, generate_reference, you need to clone this repository. More on that below.

Getting Started

In this section, you will learn to use the program to generate a code reference quickly.

This involves two steps. You need to:

  1. Write docstrings inside your GDScript code.
  2. Use one of the shell programs that ships with this add-on.

Writing your code reference

Docstring or doc-comments in GDScript don't have any special markup.

You can document classes, 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

If you need long docstrings, you can use multiple commented lines:

# A specialized steering agent that updates itself every frame so the user does
# not have to using a KinematicBody2D
# category: Specialized agents
extends GSAISpecializedAgent
class_name GSAIKinematicBody2DAgent

Generating the markdown files

We wrote two shell scripts to automate the steps in generating a code reference: ./generate_reference for Linux or MacOS, and ./generate_reference.bat for Windows.

Use either of them to quickly generate your code reference:

Generate a code reference from GDScript
Usage:
generate_reference $project_directory [options]

Required arguments:

$project_directory -- path to your Godot project directory.
This directory or one of its subdirectories should contain a
project.godot file.

Flags:

-h/--help             -- Display this help message.
-o/--output-directory -- directory path to output the documentation into.
-f/--format           -- Either `markdown` or `hugo`. If `hugo`, the output document includes a TOML front-matter at the top. Default: `markdown`.
-a/--author           -- If --format is `hugo`, controls the author property in the TOML front-matter.

To use them:

Hugo output

You can output markdown files for hugo, the static website engine.

To do so, call GDScript docs maker with the --format hugo option. You can use two extra flags with this:

--date YYYY-MM-DD, the date in iso format, if you want the documents to have a date other than today. Default: datetime.date.today()
--author author_id, the id of the author on your hugo website, to assign an the author for the documents. Default: ""

Here's how I generate the Godot Steering Toolkit's documentation. This command outputs the class reference straight into the website:

python3 -m gdscript_docs_maker $HOME/Repositories/godot-steering-toolkit/project/reference.json --format hugo --author razoric --path $HOME/Repositories/website/content/docs/godot-steering-toolkit/reference/classes/

The manual way

If you want to generate the JSON and convert it manually, there are three steps involved:

  1. Copying the GDScript files ./godot-scripts/Collector.gd and ./godot-scripts/ReferenceCollectorCLI.gd or ./godot-scripts/ReferenceCollectorCLI.gd to your Godot 3.2 project.
  2. Running the GDScript code with Godot, either from the editor (ReferenceCollector.gd) or by calling Godot from the command line (ReferenceCollectorCLI.gd).
  3. Running gdscript_docs_maker on the reference.json file that Godot generated in the previous step.

Note: to parse and collect data from GDScript code, we rely on the GDScript language server that's new in Godot 3.2.

Converting JSON

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

Usage: gdscript_docs_maker [-h] [-p PATH] [-v] [--dry-run] files [files ...]

Merges or converts json data dumped by Godot's GDScript language server to
create a code reference.

positional arguments:
  files                 A list of paths to JSON files.

optional arguments:
  -h, --help            Show this help message and exit.
  -p PATH, --path PATH  Path to the output directory.
  -v, --verbose         Set the verbosity level. For example, -vv sets the
                        verbosity level to 2. Default: 0.
  --dry-run             Run the script without creating
                        files and folders. For debugging purposes.

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].