Skip to content

Commit 46b6a84

Browse files
committed
fix docs for a all components and all hooks
1 parent 547eed3 commit 46b6a84

File tree

2 files changed

+86
-9
lines changed

2 files changed

+86
-9
lines changed

.github/workflows/static.yml

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,91 @@ on:
77

88
jobs:
99
docs:
10-
uses: pmndrs/docs/.github/workflows/build.yml@v2
11-
with:
12-
mdx: 'docs'
13-
libname: 'xr'
14-
base_path: '/xr/docs'
15-
icon: '🤳'
16-
github: 'https://github.com/pmndrs/xr'
17-
home_redirect: '/getting-started/introduction'
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
20+
- uses: pnpm/action-setup@v2
21+
name: Install pnpm
22+
with:
23+
version: 8
24+
run_install: true
25+
26+
- name: Generate Docs
27+
run: pnpm --filter packages/react/xr generate:docs
28+
29+
- id: configurepages
30+
uses: actions/configure-pages@v5
31+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#example-of-setting-an-output-parameter
32+
- id: set-base-path
33+
run: echo "BASE_PATH=${{ '/xr/docs' || steps.configurepages.outputs.base_path }}" >> "$GITHUB_OUTPUT"
34+
- run: |
35+
set -ex
36+
37+
docker run --rm --init \
38+
-v "./$MDX":/app/docs \
39+
-e BASE_PATH \
40+
-e DIST_DIR="$MDX/out$BASE_PATH" \
41+
-e MDX \
42+
-e NEXT_PUBLIC_LIBNAME \
43+
-e NEXT_PUBLIC_LIBNAME_SHORT \
44+
-e NEXT_PUBLIC_LIBNAME_DOTSUFFIX_LABEL \
45+
-e NEXT_PUBLIC_LIBNAME_DOTSUFFIX_HREF \
46+
-e OUTPUT=export \
47+
-e HOME_REDIRECT \
48+
-e MDX_BASEURL \
49+
-e SOURCECODE_BASEURL \
50+
-e EDIT_BASEURL \
51+
-e NEXT_PUBLIC_URL \
52+
-e ICON \
53+
-e LOGO \
54+
-e GITHUB \
55+
-e DISCORD \
56+
-e THEME_PRIMARY \
57+
-e THEME_SCHEME \
58+
-e THEME_CONTRAST \
59+
-e THEME_NOTE \
60+
-e THEME_TIP \
61+
-e THEME_IMPORTANT \
62+
-e THEME_WARNING \
63+
-e THEME_CAUTION \
64+
-e CONTRIBUTORS_PAT \
65+
ghcr.io/pmndrs/docs:2 npm run build
66+
env:
67+
BASE_PATH: ${{ steps.set-base-path.outputs.BASE_PATH }}
68+
MDX: 'docs'
69+
NEXT_PUBLIC_LIBNAME: 'xr'
70+
NEXT_PUBLIC_LIBNAME_SHORT: ''
71+
NEXT_PUBLIC_LIBNAME_DOTSUFFIX_LABEL: 'docs'
72+
NEXT_PUBLIC_LIBNAME_DOTSUFFIX_HREF: 'https://docs.pmnd.rs'
73+
HOME_REDIRECT: '/getting-started/introduction'
74+
MDX_BASEURL: 'https://github.com/${{ github.repository }}/raw/${{ github.ref_name }}/docs'
75+
SOURCECODE_BASEURL: 'https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}'
76+
EDIT_BASEURL: 'https://github.com/${{ github.repository }}/edit/${{ github.ref_name }}/docs'
77+
NEXT_PUBLIC_URL: ${{ steps.configurepages.outputs.base_url }}
78+
ICON: '🤳'
79+
LOGO: '/logo.png'
80+
GITHUB: 'https://github.com/pmndrs/xr'
81+
DISCORD: ''
82+
THEME_PRIMARY: '#323e48'
83+
THEME_SCHEME: 'tonalSpot'
84+
THEME_CONTRAST: '0'
85+
THEME_NOTE: '#1f6feb'
86+
THEME_TIP: '#238636'
87+
THEME_IMPORTANT: '#8957e5'
88+
THEME_WARNING: '#d29922'
89+
THEME_CAUTION: '#da3633'
90+
CONTRIBUTORS_PAT: ${{ secrets.GITHUB_TOKEN }}
91+
92+
- uses: actions/upload-pages-artifact@v3
93+
with:
94+
path: docs/out${{ steps.set-base-path.outputs.BASE_PATH }}
1895

1996
examples:
2097
runs-on: ubuntu-latest

packages/react/xr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"scripts": {
4848
"build": "tsc",
49-
"generate_docs": "typedoc",
49+
"generate:docs": "typedoc",
5050
"check:prettier": "prettier --check src",
5151
"check:eslint": "eslint \"src/**/*.{ts,tsx}\"",
5252
"fix:prettier": "prettier --write src",

0 commit comments

Comments
 (0)