CI: automatically update jsapi docs
authorPaul Spooren <mail@aparcar.org>
Thu, 7 Oct 2021 02:35:46 +0000 (16:35 -1000)
committerPaul Spooren <mail@aparcar.org>
Sat, 9 Oct 2021 03:16:04 +0000 (17:16 -1000)
Use a GitHub Action to keep the docs updated, the current onces are 14
month old and outdated.

Use latest jsdoc package

Add full URL to LuCI.html file in README.md

Ignore generated HTML files via .gitignore

Signed-off-by: Paul Spooren <mail@aparcar.org>
.github/workflows/jsdoc.yml [new file with mode: 0644]
.gitignore
docs/jsapi/README.md [new file with mode: 0644]
package.json

diff --git a/.github/workflows/jsdoc.yml b/.github/workflows/jsdoc.yml
new file mode 100644 (file)
index 0000000..dd9d952
--- /dev/null
@@ -0,0 +1,31 @@
+name: GitHub pages
+
+on:
+  push:
+    branches:
+      - master
+
+jobs:
+  deploy:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - name: Install
+        run: npm install
+
+      - name: Build
+        run: npm run doc
+
+      - name: Archive docs as artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: docs
+          path: ./docs/
+
+      - name: Deploy
+        uses: peaceiris/actions-gh-pages@v3
+        with:
+          deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
+          publish_dir: ./docs/
index 75c5bef98f28daf77eb3905d4cd3a068c75e1148..60dd7e18d6becf25a9203ee24e17305c6facd1be 100644 (file)
@@ -12,3 +12,5 @@ modules/luci-base/src/jsmin
 modules/luci-base/src/contrib/lemon
 modules/luci-base/src/plural_formula.c
 modules/luci-base/src/plural_formula.h
+docs/jsapi/*
+!docs/jsapi/README.md
diff --git a/docs/jsapi/README.md b/docs/jsapi/README.md
new file mode 100644 (file)
index 0000000..ecd9376
--- /dev/null
@@ -0,0 +1,5 @@
+# LuCI client side API documentation
+
+You can browse the JavaScript apis provided by LuCI here. A good starting point
+is the central [luci.js class](https://openwrt.github.io/luci/jsapi/LuCI.html).
+
index dfa03493c8a163abed9e9045dd646f5e36f5fd43..e4664e08cf6482409e1d2cbdfeeaaa90169ff077 100644 (file)
@@ -3,7 +3,7 @@
                "doc": "LC_ALL=C jsdoc -c jsdoc.conf.json -t node_modules/jaguarjs-jsdoc"
        },
        "devDependencies": {
-               "jsdoc": "^3.6.3",
-               "jaguarjs-jsdoc": "^1.1.0"
+               "jaguarjs-jsdoc": "^1.1.0",
+               "jsdoc": "^3.6.7"
        }
 }