Skip to content

Commit cc849ac

Browse files
authored
Merge pull request #1299 from mathjax/feature/tsdoc
Add TypeDoc and Action for docs creation
2 parents 4d1e195 + 028a0f9 commit cc849ac

5 files changed

Lines changed: 192 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
docs:
25+
environment:
26+
name: github-pages
27+
url: ${{ steps.deployment.outputs.page_url }}
28+
runs-on: ubuntu-latest
29+
name: Generate Code Docs
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- uses: pnpm/action-setup@v4
35+
name: Install pnpm
36+
with:
37+
version: 10
38+
run_install: false
39+
40+
- name: Install packages
41+
run: pnpm i
42+
43+
- name: Build docs
44+
run: pnpm typedoc
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
# Upload docs folder
50+
path: './docs'
51+
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
"prettier": "^3.5.3",
153153
"rimraf": "^5.0.10",
154154
"terser-webpack-plugin": "^5.3.14",
155+
"typedoc": "^0.28.5",
155156
"typescript": "^5.8.3",
156157
"typescript-eslint": "^8.33.1",
157158
"typescript-tools": "^0.3.1",

pnpm-lock.yaml

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig/docs.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./mjs.json",
3+
"exclude": ["./components", "./mjs", "./cjs", "./testing"]
4+
}

typedoc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"entryPoints": ["ts"],
3+
"tsconfig": "tsconfig/docs.json",
4+
"excludeNotDocumented": true,
5+
"includeVersion": false,
6+
"plugin": [],
7+
"entryPointStrategy": "expand"
8+
}
9+

0 commit comments

Comments
 (0)