Skip to content

Commit 496eaad

Browse files
Deploy Typedoc docs to GitHub pages
1 parent b80b997 commit 496eaad

File tree

7 files changed

+57
-33
lines changed

7 files changed

+57
-33
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ jobs:
4747
run: yarn install
4848
- name: Run tests
4949
run: yarn ci
50-
verify-readme:
50+
generate-typedoc:
5151
runs-on: ubuntu-latest
5252
strategy:
5353
matrix:
5454
node-version: [ 22.6 ]
55-
name: Verify README.md
55+
name: Generate typedoc
5656
steps:
5757
- uses: actions/checkout@v4
5858
- name: Use Node.js ${{ matrix.node-version }}
@@ -63,8 +63,16 @@ jobs:
6363
run: corepack enable
6464
- name: Install node modules
6565
run: yarn install
66-
- name: Verify README.md
67-
run: yarn readme && git diff README.md
66+
- name: Build
67+
run: yarn build
68+
- name: Generate typedoc
69+
run: yarn typedoc
70+
- name: Store artifact
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: github-pages
74+
path: tmp/docs
75+
if-no-files-found: error
6876
verify-install:
6977
runs-on: ubuntu-latest
7078
strategy:
@@ -80,3 +88,19 @@ jobs:
8088
run: corepack enable
8189
- name: Verify install
8290
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false npm install "https://github.com/martijnversluis/ChordSheetJS/tree/$GITHUB_SHA"
91+
92+
typedoc:
93+
runs-on: ubuntu-latest
94+
needs: generate-typedoc
95+
permissions:
96+
pages: write # to deploy to Pages
97+
id-token: write # to verify the deployment originates from an appropriate source
98+
environment:
99+
name: github-pages
100+
url: ${{ steps.deployment.outputs.page_url }}
101+
steps:
102+
- name: Deploy to GitHub Pages
103+
uses: actions/deploy-pages@v4
104+
with:
105+
token: ${{ secrets.GITHUB_TOKEN }}
106+
artifact_name: github-pages

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,23 @@ jobs:
2121
uses: softprops/action-gh-release@v2
2222
with:
2323
files: lib/bundle.js
24+
- name: Store artifact
25+
uses: actions/upload-artifact@v2
26+
with:
27+
name: github-pages
28+
path: tmp/docs
29+
30+
typedoc:
31+
runs-on: ubuntu-latest
32+
needs: build
33+
permissions:
34+
pages: write # to deploy to Pages
35+
id-token: write # to verify the deployment originates from an appropriate source
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
steps:
40+
- name: Deploy to GitHub Pages
41+
uses: actions/deploy-pages@v4
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"tsc": "^2.0.4",
5959
"tsx": "^4.10.5",
6060
"typedoc": "^0.27.1",
61-
"typedoc-plugin-markdown": "^4.3.0",
6261
"typescript": "^5.6.2",
6362
"typescript-eslint": "^8.6.0"
6463
},

src/chord_sheet/metadata.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ class Metadata extends MetadataAccessors {
8888
*
8989
* This method deprecates direct property access, eg: metadata['author']
9090
*
91-
* Examples:
92-
*
91+
* @example
9392
* const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] });
9493
* metadata.get('lyricist') // => 'Pete'
9594
* metadata.get('author') // => ['John', 'Mary']

typedoc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://typedoc.org/schema.json",
3+
"entryPoints": ["./src/index.ts"],
4+
"out": "tmp/docs",
5+
"excludeNotDocumented": true,
6+
"logLevel": "Error"
7+
}

unibuild.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import buildScales from './script/build_scales';
1111
import buildChordProSectionGrammar from './script/build_chord_pro_section_grammar';
1212

1313
const {
14-
main, source, types, bundle,
14+
main, types, bundle,
1515
} = packageJSON;
1616

1717
interface BuildOptions {
@@ -113,21 +113,6 @@ unibuild((u: Builder) => {
113113
chordDefinitionParser,
114114
];
115115

116-
u.asset('readme', {
117-
input: ['INTRO.md', 'src', ...codeGeneratedAssets],
118-
outfile: 'README.md',
119-
command: ({ input: [intro], outfile }) => {
120-
const tmpDir = 'tmp/docs';
121-
return [
122-
`typedoc --plugin typedoc-plugin-markdown --out ${tmpDir} ${source} --logLevel Error`,
123-
`cat ${intro} > ${outfile}`,
124-
`concat-md --decrease-title-levels --dir-name-as-title ${tmpDir} >> ${outfile}`,
125-
`rm -rf ${tmpDir}`,
126-
];
127-
},
128-
releaseOnly: true,
129-
});
130-
131116
const jsBuild = u.asset('sources', {
132117
input: codeGeneratedAssets,
133118
outfile: main,

yarn.lock

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3555,7 +3555,6 @@ __metadata:
35553555
tsc: "npm:^2.0.4"
35563556
tsx: "npm:^4.10.5"
35573557
typedoc: "npm:^0.27.1"
3558-
typedoc-plugin-markdown: "npm:^4.3.0"
35593558
typescript: "npm:^5.6.2"
35603559
typescript-eslint: "npm:^8.6.0"
35613560
languageName: unknown
@@ -9386,15 +9385,6 @@ __metadata:
93869385
languageName: node
93879386
linkType: hard
93889387

9389-
"typedoc-plugin-markdown@npm:^4.3.0":
9390-
version: 4.3.0
9391-
resolution: "typedoc-plugin-markdown@npm:4.3.0"
9392-
peerDependencies:
9393-
typedoc: 0.27.x
9394-
checksum: 10c0/2db27e6508fc0047b9608edc084b6c43bbe88e03dbdc288b33a77ecba75d1c5561236b5e5df2153b50ff781d79684a90d6b2b1c099f20839310275cb4e142eb7
9395-
languageName: node
9396-
linkType: hard
9397-
93989388
"typedoc@npm:^0.27.1":
93999389
version: 0.27.1
94009390
resolution: "typedoc@npm:0.27.1"

0 commit comments

Comments
 (0)