Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit acc12d3

Browse files
feat: add offline docs (#8527)
1 parent 164672e commit acc12d3

18 files changed

+5004
-9
lines changed

.github/actions/setup-node/action.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ runs:
1313
cache-dependency-path: "site/yarn.lock"
1414
- name: Install node_modules
1515
shell: bash
16-
run: ./scripts/yarn_install.sh
16+
run: ../scripts/yarn_install.sh
17+
working-directory: site

.github/workflows/release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ jobs:
259259
env:
260260
CODER_BASE_IMAGE_TAG: ${{ steps.image-base-tag.outputs.tag }}
261261

262+
- name: Generate offline docs
263+
run: |
264+
version="$(./scripts/version.sh)"
265+
make -j build/coder_docs_"$version".tgz
266+
262267
- name: ls build
263268
run: ls -lh build
264269

.prettierrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
printWidth: 80
55
semi: false
66
trailingComma: all
7+
useTabs: false
8+
tabWidth: 2
79
overrides:
810
- files:
911
- README.md

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,18 @@ build/coder_helm_$(VERSION).tgz:
356356
--output "$@"
357357

358358
site/out/index.html: site/package.json $(shell find ./site $(FIND_EXCLUSIONS) -type f \( -name '*.ts' -o -name '*.tsx' \))
359-
./scripts/yarn_install.sh
360359
cd site
360+
../scripts/yarn_install.sh
361361
yarn build
362362

363+
offlinedocs/out/index.html: $(shell find ./offlinedocs $(FIND_EXCLUSIONS) -type f) $(shell find ./docs $(FIND_EXCLUSIONS) -type f | sed 's: :\\ :g')
364+
cd offlinedocs
365+
../scripts/yarn_install.sh
366+
yarn export
367+
368+
build/coder_docs_$(VERSION).tgz: offlinedocs/out/index.html
369+
tar -czf "$@" -C offlinedocs/out .
370+
363371
install: build/coder_$(VERSION)_$(GOOS)_$(GOARCH)$(GOOS_BIN_EXT)
364372
install_dir="$$(go env GOPATH)/bin"
365373
output_file="$${install_dir}/coder$(GOOS_BIN_EXT)"

offlinedocs/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

offlinedocs/.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
37+
# content
38+
public/images/

offlinedocs/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

offlinedocs/next.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
reactStrictMode: true,
4+
trailingSlash: true,
5+
}
6+
7+
module.exports = nextConfig

offlinedocs/package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "coder-docs-generator",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "yarn copy-images && next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"export": "yarn copy-images && next build && next export",
10+
"copy-images": "sh ./scripts/copyImages.sh"
11+
},
12+
"dependencies": {
13+
"@chakra-ui/react": "2.7.1",
14+
"@emotion/react": "11",
15+
"@emotion/styled": "11",
16+
"archiver": "5.3.1",
17+
"framer-motion": "6",
18+
"front-matter": "4.0.2",
19+
"fs-extra": "10.1.0",
20+
"lodash": "4.17.21",
21+
"next": "12.1.6",
22+
"react": "18.2.0",
23+
"react-dom": "18.2.0",
24+
"react-icons": "4.4.0",
25+
"react-markdown": "8.0.3",
26+
"rehype-raw": "6.1.1",
27+
"remark-gfm": "3.0.1"
28+
},
29+
"devDependencies": {
30+
"@types/node": "18.0.0",
31+
"@types/react": "18.0.14",
32+
"@types/react-dom": "18.0.5",
33+
"eslint": "8.17.0",
34+
"eslint-config-next": "12.1.6",
35+
"typescript": "4.7.3"
36+
}
37+
}

0 commit comments

Comments
 (0)