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

Skip to content

feat: add offline docs #8527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,28 @@ jobs:
# For gh CLI. We need a real token since we're commenting on a PR in a
# different repo.
GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }}

offline-docs:
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Required by Chromatic for build-over-build history, otherwise we
# only get 1 commit on shallow checkout.
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.20.1
- run: yarn install
working-directory: ./offlinedocs
- run: yarn export
working-directory: ./offlinedocs
- name: Tar files
run: tar -cvf docs.tar -C offlinedocs/out .
- name: Upload docs artifact
uses: actions/upload-artifact@v3
with:
name: docs
path: docs.tar
3 changes: 3 additions & 0 deletions offlinedocs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
38 changes: 38 additions & 0 deletions offlinedocs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo

# content
public/images/
5 changes: 5 additions & 0 deletions offlinedocs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
7 changes: 7 additions & 0 deletions offlinedocs/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
trailingSlash: true,
}

module.exports = nextConfig
37 changes: 37 additions & 0 deletions offlinedocs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "coder-docs-generator",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "yarn copy-images && next dev",
"build": "next build",
"start": "next start",
"export": "yarn copy-images && next build && next export",
"copy-images": "sh ./scripts/copyImages.sh"
},
"dependencies": {
"@chakra-ui/react": "2.7.1",
"@emotion/react": "11",
"@emotion/styled": "11",
"archiver": "5.3.1",
"framer-motion": "6",
"front-matter": "4.0.2",
"fs-extra": "10.1.0",
"lodash": "4.17.21",
"next": "12.1.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "4.4.0",
"react-markdown": "8.0.3",
"rehype-raw": "6.1.1",
"remark-gfm": "3.0.1"
},
"devDependencies": {
"@types/node": "18.0.0",
"@types/react": "18.0.14",
"@types/react-dom": "18.0.5",
"eslint": "8.17.0",
"eslint-config-next": "12.1.6",
"typescript": "4.7.3"
}
}
29 changes: 29 additions & 0 deletions offlinedocs/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { ChakraProvider, extendTheme } from "@chakra-ui/react"
import type { AppProps } from "next/app"
import Head from "next/head"

const theme = extendTheme({
styles: {
global: {
body: {
bg: "gray.50",
},
},
},
})

const MyApp: React.FC<AppProps> = ({ Component, pageProps }) => {
return (
<>
<Head>
<link rel="mask-icon" href="/favicon.svg" color="#000000" />
<link rel="alternate icon" type="image/png" href="/favicon.png" />
</Head>
<ChakraProvider theme={theme}>
<Component {...pageProps} />
</ChakraProvider>
</>
)
}

export default MyApp
Loading