Skip to content

Commit 0525d4d

Browse files
authored
Merge pull request #85 from deep-entertainment/docs-docker-update
docs: Updated README to reflect changes and include docker information
2 parents 951d97c + a956ff8 commit 0525d4d

File tree

2 files changed

+50
-29
lines changed

2 files changed

+50
-29
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
- '**'
77
tags:
88
- 'v*.*.*'
9-
pull_request:
10-
branches:
11-
- 'master'
129

1310
jobs:
1411
build:
@@ -45,3 +42,10 @@ jobs:
4542
push: ${{ github.event_name != 'pull_request' }}
4643
tags: ${{ steps.meta.outputs.tags }}
4744
labels: ${{ steps.meta.outputs.labels }}
45+
- name: Docker Hub Description
46+
uses: peter-evans/dockerhub-description@v2
47+
with:
48+
username: ${{ secrets.DOCKER_USERNAME }}
49+
password: ${{ secrets.DOCKER_TOKEN }}
50+
repository: gdquest/gdscript-docs-maker
51+

README.md

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,45 @@
11
# GDScript Docs Maker
22

3+
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/gdquest/gdscript-docs-maker)](https://github.com/GDQuest/gdscript-docs-maker) [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/gdquest/gdscript-docs-maker?label=Docker%20tag&sort=semver)](https://hub.docker.com/repository/docker/gdquest/gdscript-docs-maker)
4+
35
![Project banner](./assets/gdscript-docs-maker-banner.svg)
46

5-
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.
7+
# Introduction
68

7-
If you make plugins or a framework for Godot, GDScript Docs Maker will help you save a lot of time documenting your code.
9+
GDScript 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](https://daringfireball.net/projects/markdown/syntax) or [hugo](https://gohugo.io/) format. If you make plugins or a framework for Godot, GDScript Docs Maker will generate API reference documentation from your code.
810

911
It creates documents following Godot's built-in class reference. You can see an example with our [Godot Steering Toolkit documentation](https://www.gdquest.com/docs/godot-steering-toolkit/reference/)
1012

1113
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
1214

13-
**Table of Contents**
14-
15-
- [Installing](#installing)
16-
- [Getting Started](#getting-started)
17-
- [Writing your code reference](#writing-your-code-reference)
18-
- [Generating the markdown files](#generating-the-markdown-files)
19-
- [Hugo output](#hugo-output)
15+
- [Usage](#usage)
16+
* [Using the container image](#using-the-container-image)
17+
* [Local installation](#local-installation)
18+
* [Writing your code reference](#writing-your-code-reference)
19+
* [Generating the markdown files](#generating-the-markdown-files)
20+
* [Hugo output](#hugo-output)
2021
- [The manual way](#the-manual-way)
21-
- [Converting JSON](#converting-json)
22+
+ [Converting JSON](#converting-json)
2223

2324
<!-- markdown-toc end -->
2425

25-
**Note**: This program requires Godot 3.2+ and Python 3.7+ to work.
26+
# Usage
27+
28+
GDScript Docs Maker can be either used using the official [Docker image](https://hub.docker.com/r/gdquest/gdscript-docs-maker) or by installing it locally. For the docker image, only [Docker](https://www.docker.com/get-started) is required.
29+
30+
For the local installation, Godot 3.2+ and Python 3.7+ are required.
31+
32+
## Using the container image
33+
34+
To generate your API documentation, you mount the path of your game and the path of the output into the container and run it like this:
35+
36+
```
37+
docker run --rm -v /my/game:/game -v /my/game/docs/api:/output gdquest/gdscript-docs-maker:latest /game -o /output
38+
```
39+
40+
This will generate the API documentation in the subpath `docs/api` of your game located at `/my/game`. See below for further parameters.
2641

27-
## Installing
42+
## Local installation
2843

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

@@ -38,16 +53,7 @@ python -m pip install gdscript_docs_maker
3853

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

41-
## Getting Started
42-
43-
In this section, you will learn to use the program to generate a code reference quickly.
44-
45-
This involves two steps. You need to:
46-
47-
1. Write docstrings inside your GDScript code.
48-
2. Use one of the shell programs that ships with this add-on.
49-
50-
### Writing your code reference
56+
## Writing your code reference
5157

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

@@ -80,7 +86,7 @@ extends GSAISpecializedAgent
8086
class_name GSAIKinematicBody2DAgent
8187
```
8288

83-
### Generating the markdown files
89+
## Generating the markdown files
8490

8591
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.
8692

@@ -97,12 +103,23 @@ $project_directory -- path to your Godot project directory.
97103
This directory or one of its subdirectories should contain a
98104
project.godot file.
99105

100-
Flags:
106+
Options:
101107

102108
-h/--help -- Display this help message.
103109
-o/--output-directory -- directory path to output the documentation into.
104-
-f/--format -- Either `markdown` or `hugo`. If `hugo`, the output document includes a TOML front-matter at the top. Default: `markdown`.
110+
-d/--directory -- Name of a directory to find files and generate the code reference in the Godot project.
111+
You can use the option multiple times to generate a reference for multiple directories.
112+
-f/--format -- Either `markdown` or `hugo`. If `hugo`, the output document includes a TOML front-matter
113+
at the top. Default: `markdown`.
105114
-a/--author -- If --format is `hugo`, controls the author property in the TOML front-matter.
115+
116+
117+
Usage example:
118+
119+
generate_reference ~/Repositories/other/nakama-godot/project/ -o export-nakama -d addons
120+
121+
This command walks files in the res://addons directory of the Godot Nakama project, and converts it
122+
to markdown files output in ./export-nakama.
106123
```
107124

108125
To use them:
@@ -127,7 +144,7 @@ Here's how I generate the Godot Steering Toolkit's documentation. This command o
127144
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/
128145
```
129146
130-
## The manual way
147+
# The manual way
131148
132149
If you want to generate the JSON and convert it manually, there are three steps involved:
133150

0 commit comments

Comments
 (0)