From cc556df59fcd404b6f023c85640480feb149fd1f Mon Sep 17 00:00:00 2001 From: Frank Hinek Date: Sun, 23 Apr 2023 07:34:49 -0400 Subject: [PATCH] Improve generated doc site styling Signed-off-by: Frank Hinek --- .github/workflows/docs-publish.yml | 9 ++++-- jsdoc.json | 46 ++++++++++++++++-------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml index 52a154169..d39cf11f8 100644 --- a/.github/workflows/docs-publish.yml +++ b/.github/workflows/docs-publish.yml @@ -6,7 +6,6 @@ on: push: branches: - main - - docs/autogenerate # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -35,13 +34,17 @@ jobs: node-version: 18 - name: Install dependencies - run: | + run: | npm ci npm i jsdoc npm i clean-jsdoc-theme - name: Generate documentation - run: npx jsdoc -c jsdoc.json + run: | + echo "# Web5 JS SDK" > README-docs.md + echo "Select from the menu on the left to view API reference documentation." >> README-docs.md + npx jsdoc -c jsdoc.json + curl -o docs/favicon.ico https://developer.tbd.website/img/favicon.ico - name: Upload documentation artifacts uses: actions/upload-artifact@v3 diff --git a/jsdoc.json b/jsdoc.json index 1505fc5ab..56ae93fe2 100644 --- a/jsdoc.json +++ b/jsdoc.json @@ -2,37 +2,39 @@ "opts": { "encoding": "utf8", "destination": "./docs/", + "readme": "README-docs.md", "recurse": true, - "template": "node_modules/clean-jsdoc-theme" + "template": "node_modules/clean-jsdoc-theme", + "theme_opts": { + "base_url": "https://tbd54566975.github.io/web5-js/", + "default_theme": "dark", + "favicon": "favicon.ico", + "homepageTitle": "Web5 JS API Reference", + "menu": [ + { + "title": "GitHub", + "link": "https://github.com/TBD54566975/web5-js", + "target": "_blank" + } + ], + "search": true, + "title": "API Reference" + } }, "plugins": [], "recurseDepth": 10, "source": { - "include": ["src"], - "includePattern": ".+\\.js(doc|x)?$", - "excludePattern": "(^|\\/|\\\\)_" + "include": ["src"], + "includePattern": ".+\\.js(doc|x)?$", + "excludePattern": "(^|\\/|\\\\)_" }, "sourceType": "module", "tags": { - "allowUnknownTags": true, - "dictionaries": ["jsdoc","closure"] + "allowUnknownTags": true, + "dictionaries": ["jsdoc","closure"] }, "templates": { - "cleverLinks": false, - "monospaceLinks": false - }, - "theme_opts": { - "base_url": "https://tbd54566975.github.io/web5-js/", - "default_theme": "dark", - "homepageTitle": "API Reference", - "menu": [ - { - "title": "GitHub", - "link": "https://github.com/TBD54566975/web5-js", - "target": "_blank" - } - ], - "search": true, - "title": "Web5 JS SDK" + "cleverLinks": false, + "monospaceLinks": false } }