From 694134582d9430341c99eb66991ac47a97ebfade Mon Sep 17 00:00:00 2001 From: Ottatop Date: Sat, 26 Aug 2023 22:26:32 -0500 Subject: [PATCH] Attempt automatic doc gen --- .github/workflows/ldoc.yml | 6 ++++-- api/lua/output.lua | 1 + api/lua/tag.lua | 1 + api/lua/window.lua | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ldoc.yml b/.github/workflows/ldoc.yml index 167d4ff..7309de1 100644 --- a/.github/workflows/ldoc.yml +++ b/.github/workflows/ldoc.yml @@ -32,12 +32,14 @@ jobs: uses: leafo/gh-actions-luarocks@v4 - name: Setup dependencies run: luarocks install ldoc + - name: Generate LDoc compatible code + run: git clone https://github.com/Ottatop/ldoc_gen --depth 1 && cd ./ldoc_gen && cargo run -- -p ../api/lua - name: Build docs - run: cd ./api/lua/doc && ldoc . && cd ../../.. + run: cd ./.ldoc_gen && cp ../../api/lua/doc/ldoc.css ../../api/lua/doc/config.ld . && ldoc . && cd ../.. - name: Deploy if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./api/lua/doc/doc + publish_dir: ./ldoc_gen/.ldoc_gen/doc destination_dir: ${{ env.BRANCH_NAME }} diff --git a/api/lua/output.lua b/api/lua/output.lua index bbf827a..f103fe9 100644 --- a/api/lua/output.lua +++ b/api/lua/output.lua @@ -3,6 +3,7 @@ ---@class OutputModule local output_module = {} +---@classmod ---@class Output A display. ---@field private _name string The name of this output (or rather, of its connector). local output = {} diff --git a/api/lua/tag.lua b/api/lua/tag.lua index 263ac84..b427a59 100644 --- a/api/lua/tag.lua +++ b/api/lua/tag.lua @@ -15,6 +15,7 @@ local tag_module = {} ---@alias TagTable { [1]: string, [2]: (string|Output)? } ---@alias TagTableNamed { name: string, output: (string|Output)? } +---@classmod ---@class Tag ---@field private _id integer The internal id of this tag. local tag = {} diff --git a/api/lua/window.lua b/api/lua/window.lua index 3daf9c5..f5c9836 100644 --- a/api/lua/window.lua +++ b/api/lua/window.lua @@ -3,6 +3,7 @@ ---@class WindowModule local window_module = {} +---@classmod ---@class Window ---@field private _id integer The internal id of this window local window = {}