Skip to content

Commit 1fbd594

Browse files
committed
feat(docs): init docs
1 parent 7e02171 commit 1fbd594

File tree

390 files changed

+15654
-1796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

390 files changed

+15654
-1796
lines changed

.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
"unicorn/prefer-node-protocol": "off"
2626
}
2727
},
28+
{
29+
"files": ["docs/**/*.*"],
30+
"rules": {
31+
"@typescript-eslint/no-require-imports": "off"
32+
}
33+
},
2834
{
2935
"files": [
3036
"**/*.md/*.*"

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,13 @@ result.json
2222
.svelte-kit
2323
.eslintcache
2424
vite.config.ts.timestamp-*
25+
26+
docs/.docusaurus
27+
docs/netlifyDeployPreview/*
28+
docs/changelog
29+
!docs/netlifyDeployPreview/index.html
30+
!docs/netlifyDeployPreview/_redirects
31+
32+
docs/_dogfooding/_swizzle_theme_tests
33+
34+
docs/i18n/**/*

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,25 @@
1414
"cachedir",
1515
"ccsp",
1616
"Chatgpt",
17+
"chedeau",
1718
"clsx",
1819
"codicon",
1920
"colorette",
2021
"consola",
22+
"esbuild",
2123
"esno",
2224
"execa",
2325
"gptr",
26+
"hideable",
2427
"Jinming",
2528
"langchain",
29+
"linebreak",
2630
"localstorage",
2731
"nicepkg",
2832
"OPENAI",
2933
"OVSE",
3034
"ovsx",
35+
"rehype",
3136
"tablist",
3237
"tabpanel",
3338
"tagify",

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
...no

docs/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
}

docs/community/0-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Support

docs/community/1-team.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Team
2+
3+
import {
4+
ActiveTeamRow,
5+
HonoraryAlumniTeamRow,
6+
StudentFellowsTeamRow,
7+
} from '@site/src/components/TeamProfileCards';
8+
9+
## Active Team {#active-team}
10+
11+
Current members of the GPT Runner team are listed in alphabetical order below.
12+
13+
<ActiveTeamRow />

docs/community/2-contributing.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Contributing
3+
hide_title: true
4+
sidebar_label: Contributing
5+
---
6+
7+
```mdx-code-block
8+
import Contributing, {toc as ContributingTOC} from "@site/../CONTRIBUTING.md"
9+
10+
<Contributing />
11+
12+
export const toc = ContributingTOC;
13+
```

docs/constants.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export type Lang = 'en' | 'zh-CN'
2+
export const DEFAULT_LOCALE = 'en'
3+
4+
// for browser
5+
if (typeof process === 'undefined' && typeof window !== 'undefined') {
6+
(window as any).process = {
7+
env: {},
8+
}
9+
}
10+
11+
const isNetlify = Boolean(process.env.NETLIFY)
12+
export const ENV = {
13+
isNetlify,
14+
siteName: process.env.SITE_NAME,
15+
isDev: process.env.NODE_ENV === 'development',
16+
isDeployPreview: isNetlify && process.env.CONTEXT === 'deploy-preview',
17+
isBranchDeploy: isNetlify && process.env.CONTEXT === 'branch-deploy',
18+
isBuildFast: Boolean(process.env.BUILD_FAST),
19+
baseUrl: process.env.BASE_URL ?? '/',
20+
isI18nStaging: process.env.I18N_STAGING === 'true',
21+
currentLocale: (process.env.CURRENT_LOCALE ?? DEFAULT_LOCALE) as Lang,
22+
23+
crowdinToken: process.env.CROWDIN_PERSONAL_TOKEN,
24+
}
25+
26+
// export const THEME_COLOR = '#19c37d'
27+
export const THEME_COLOR = 'rgb(25,195,125)'
28+
export const ORG_NAME = 'nicepkg'
29+
export const PROJECT_NAME = 'gpt-runner'
30+
export const PROJECT_DISPLAY_NAME = 'GPT Runner'
31+
export const GITHUB_LINK = `https://github.com/${ORG_NAME}/${PROJECT_NAME}`
32+
export const SITE_URL = 'http://gpt-runner.nicepkg.cn'

docs/delay-crowdin.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
We delay a bit the i18n staging deployment
3+
Because sometimes, prod + i18n-staging call this script at the exact same time
4+
And then both try to dl the translations at the same time, and then we have a
5+
409 error. This delay makes sure prod starts to dl the translations in priority
6+
Used in conjunction with waitForCrowdin.js (which is not enough)
7+
*/
8+
9+
import { ENV, PROJECT_NAME } from './constants'
10+
11+
async function delay(ms: number) {
12+
return new Promise((resolve) => {
13+
setTimeout(resolve, ms)
14+
})
15+
}
16+
17+
if (
18+
ENV.isNetlify
19+
&& ENV.siteName === `${PROJECT_NAME}-i18n-staging`
20+
) {
21+
console.log(
22+
`[Crowdin] Delaying the ${PROJECT_NAME}-i18n-staging deployment to avoid 409 errors`,
23+
)
24+
await delay(30000)
25+
}

0 commit comments

Comments
 (0)