From c689b8c4a1784632604d99fbe87a8327b3b96cdd Mon Sep 17 00:00:00 2001 From: raldone01 Date: Tue, 16 Jan 2024 07:58:02 +0100 Subject: [PATCH] I want die. --- .github/workflows/gdscript_docs_maker.patch | 43 +++++++++++++++ .github/workflows/generate_docs.yml | 59 +++++++++++++++++++++ README.md | 4 ++ project.godot | 24 +++++++++ 4 files changed, 130 insertions(+) create mode 100644 .github/workflows/gdscript_docs_maker.patch create mode 100644 .github/workflows/generate_docs.yml create mode 100644 project.godot diff --git a/.github/workflows/gdscript_docs_maker.patch b/.github/workflows/gdscript_docs_maker.patch new file mode 100644 index 0000000..7876a5f --- /dev/null +++ b/.github/workflows/gdscript_docs_maker.patch @@ -0,0 +1,43 @@ +From 0deaca31d9126be428e75f2992435dd564bd5e64 Mon Sep 17 00:00:00 2001 +From: raldone01 +Date: Tue, 16 Jan 2024 06:14:59 +0100 +Subject: [PATCH] fixes + +--- + Dockerfile | 5 ++--- + src/gdscript_docs_maker/gdscript_objects.py | 2 ++ + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/Dockerfile b/Dockerfile +index 3cc6fbc..91562ea 100644 +--- a/Dockerfile ++++ b/Dockerfile +@@ -1,10 +1,9 @@ +-FROM docker.io/barichello/godot-ci:latest ++FROM docker.io/barichello/godot-ci:4.1.3 + ++RUN apt update && apt -y install python3 python3-setuptools + + COPY . /app + +-RUN apt update && apt -y install python3 python3-setuptools +- + WORKDIR /app + + RUN python3 setup.py install +diff --git a/src/gdscript_docs_maker/gdscript_objects.py b/src/gdscript_docs_maker/gdscript_objects.py +index 827b110..bcf1e83 100644 +--- a/src/gdscript_docs_maker/gdscript_objects.py ++++ b/src/gdscript_docs_maker/gdscript_objects.py +@@ -285,6 +285,8 @@ class GDScriptClass: + # the extends_class field is a list in json even though it only has one + # class. + extends: str = data["extends_class"][0] if data["extends_class"] else "" ++ if not ("description" in data): ++ data["description"] = "" + return GDScriptClass( + data["name"], + extends, +-- +2.43.0 + diff --git a/.github/workflows/generate_docs.yml b/.github/workflows/generate_docs.yml new file mode 100644 index 0000000..0dcbfe5 --- /dev/null +++ b/.github/workflows/generate_docs.yml @@ -0,0 +1,59 @@ +name: Generate and Deploy Documentation + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + build-docs: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Clone gdscript-docs-maker + run: | + git clone https://github.com/GDQuest/gdscript-docs-maker.git + cd gdscript-docs-maker + git checkout 07cb0d8f0af6da745260d7bfabfc475504c413f1 + git apply ../.github/workflows/gdscript_docs_maker.patch + docker build -t gdscript-docs-maker . + cd .. + + - name: Generate Documentation + run: | + docker run --rm -v ${{ github.workspace }}:/game -v ${{ github.workspace }}/docs/api-md:/output docker.io/library/gdscript-docs-maker /game -o /output + + - name: Fix permissions and create output directory + run: | + sudo chown -R $USER:$USER docs/ + mkdir -p docs/api + + - name: Download CSS + run: | + curl -sL https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.5.0/github-markdown.min.css -o docs/api/github-markdown.min.css + + - uses: docker://pandoc/latex:2.9 + with: + args: >- # allows you to break string into multiple lines + --from markdown + --to html + --standalone + --css github-markdown.min.css + --output=docs/api/index.tmp.html + docs/api-md/logger.gd.md + + - name: Fix body class + run: | + sudo chown -R $USER:$USER docs/ + sed 's///g' docs/api/index.tmp.html > docs/api/index.html + rm docs/api/index.tmp.html + + - name: Deploy Documentation + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/api diff --git a/README.md b/README.md index fb381e2..a9b69a1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # gdlogging Godot addon +![Doc Gen Badge](https://github.com/raldone01/godot_addon_gdlogging/actions/workflows/generate_docs.yml/badge.svg) + +[Documentation](https://raldone01.github.io/godot_addon_gdlogging/) + This is a composable logging addon for version 4 of the [Godot game engine](https://godotengine.org/). ## Usage diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..57a18e6 --- /dev/null +++ b/project.godot @@ -0,0 +1,24 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="gen_docs" +config/description="gen" +config/features=PackedStringArray("4.2", "Forward Plus") +config/icon="res://assets/icons/plugin_icon_white.svg" + +[autoload] + +Log="*res://logger.gd" + +[dotnet] + +project/assembly_name="gen_docs"