Skip to content

Commit 0013ee8

Browse files
authored
Prepare typedoc (#959)
1 parent ea4149c commit 0013ee8

File tree

5 files changed

+127
-0
lines changed

5 files changed

+127
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Workflow for deploying docs static content to GitHub Pages.
2+
name: docs
3+
4+
on:
5+
push:
6+
branches: [master]
7+
# Allows you to run this workflow manually from the Actions tab.
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run
17+
# in-progress and latest queued. However, do NOT cancel in-progress runs as we
18+
# want to allow these production deployments to complete.
19+
concurrency:
20+
group: 'pages'
21+
cancel-in-progress: false
22+
23+
jobs:
24+
# Single deploy job since we're just deploying.
25+
deploy:
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
29+
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 2
37+
38+
- name: Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 24
42+
43+
- name: Check if version has been updated
44+
id: versionCheck
45+
uses: EndBug/version-check@v2
46+
47+
- name: Log when version has changed
48+
if: steps.versionCheck.outputs.changed == 'true'
49+
run: 'echo "Version changed, new version: ${{ steps.versionCheck.outputs.version }} (${{ steps.versionCheck.outputs.type }})"'
50+
51+
- name: Log when version has not changed
52+
if: steps.versionCheck.outputs.changed == 'false'
53+
run: 'echo "Version did not change"'
54+
55+
- name: npm ci
56+
if: steps.versionCheck.outputs.changed == 'true'
57+
run: npm ci --foreground-scripts
58+
59+
- name: npm run docs
60+
if: steps.versionCheck.outputs.changed == 'true'
61+
run: npm run docs
62+
63+
- name: Upload docs
64+
if: steps.versionCheck.outputs.changed == 'true'
65+
uses: actions/upload-pages-artifact@v3
66+
with:
67+
path: docs/
68+
69+
- name: Deploy docs to GitHub Pages
70+
if: steps.versionCheck.outputs.changed == 'true'
71+
id: deployment
72+
uses: actions/deploy-pages@v4

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Use prettier.
88
- Prepare environment for TS.
99
- Rewrite tests to TS (#958).
10+
- Prepare typedoc (#959).
1011

1112
### 3.12.0
1213

File renamed without changes.

docs-assets/custom-styles.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* Remove ugly square in bottom-right corner when scroll shows up. */
2+
*::-webkit-scrollbar {
3+
width: 0px;
4+
}
5+
6+
/* Add margin after code. */
7+
.tsd-comment {
8+
margin-bottom: 2em;
9+
}
10+
11+
/* Avoid word wrapping when code doesn't fit into avaiable width. */
12+
.tsd-comment > pre {
13+
white-space: pre;
14+
overflow: scroll;
15+
}
16+
17+
/* Remove ugly border radius in code. */
18+
.tsd-comment > pre,
19+
.tsd-comment > code {
20+
border-radius: 0px;
21+
}

typedoc.config.mjs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Configuration for Typedoc.
3+
*/
4+
5+
/** @type {Partial<import('typedoc').TypeDocOptions>} */
6+
const config = {
7+
entryPoints: ['src/JsSIP.js'],
8+
out: 'docs',
9+
skipErrorChecking: false,
10+
exclude: ['src/**/*.d.ts', 'src/test/**/test-*.ts'],
11+
excludePrivate: true,
12+
excludeProtected: true,
13+
excludeNotDocumented: true,
14+
excludeInternal: true,
15+
excludeExternals: true,
16+
includeVersion: true,
17+
gitRemote: 'origin',
18+
hideGenerator: false,
19+
treatWarningsAsErrors: true,
20+
cacheBust: true,
21+
categorizeByGroup: false,
22+
categoryOrder: ['Config', 'UA', 'RTCSession', '*'],
23+
searchInComments: true,
24+
readme: 'README.md',
25+
projectDocuments: ['README.md', 'LICENSE.md'],
26+
navigationLinks: {
27+
GitHub: 'https://github.com/versatica/jssip',
28+
NPM: 'https://www.npmjs.com/package/jssip',
29+
},
30+
customCss: './docs-assets/custom-styles.css',
31+
};
32+
33+
export default config;

0 commit comments

Comments
 (0)