Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.26 KB

README.md

File metadata and controls

52 lines (35 loc) · 1.26 KB

Generate Markdown doc files from docstrings in Godot 4

This tool was scarcely tested, bugs may happen.

This tool is made for Godot 4

Purpose

Godot 4 has a neat docs tab where you can see autogenerated pages for scripts you've written. But there are cases when you would want to port documentation to another place, for example to a wiki or an api reference website. This is where this tool can become useful.

Installation

  • Download the project
  • Make sure you have Python 3.11 or later
  • Run pip install jinja2==3.1.2

Usage

Run python script from the Godot project directory to generate docs:

py path/to/gdscript_to_md_docs/generate_docs.py

Alternatively you can specify the Godot project directory:

py generate_docs.py -p path/to/godot_project

generate_docs script has more flags, which you can learn about using:

py generate_docs.py --help

Custom templates

The final markdown is created using a jinja2 template, which can be modified to your liking. See the base file to see which data is passed to a template.

BBCode

This tool automatically converts some of the BBCode tags, but the list is quite limited. Here are the supported tags:

  • [b]
  • [i]
  • [s]
  • [code]
  • [codeblock]
  • [br]
  • [url]
  • [img]