Skip to content

Commit 71302dc

Browse files
authored
feat: Doctools (#6)
1 parent 069fa07 commit 71302dc

File tree

8 files changed

+174
-125
lines changed

8 files changed

+174
-125
lines changed

.github/actions-node/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:lts-slim
2+
3+
LABEL "com.github.actions.name"="node"
4+
LABEL "com.github.actions.description"="Deploy to Github Pages"
5+
LABEL "com.github.actions.icon"="mic"
6+
LABEL "com.github.actions.color"="purple"
7+
8+
LABEL "repository"="https://github.com/eggjs/eggjs.github.io"
9+
LABEL "homepage"="https://github.com/eggjs/eggjs.github.io"
10+
LABEL "maintainer"="Suyi <[email protected]>"
11+
12+
RUN \
13+
apt-get update -y && \
14+
apt-get install -y git
15+
16+
ADD entrypoint.sh /entrypoint.sh
17+
ENTRYPOINT ["/entrypoint.sh"]

.github/actions-node/entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh -l
2+
3+
sh -c "env";
4+
5+
sh -c "$*";

.github/main.workflow

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
workflow "Push" {
2+
on = "push"
3+
resolves = ["Deployment"]
4+
}
5+
6+
action "Installation" {
7+
needs = "Filters for GitHub Actions"
8+
uses = "./.github/actions-node/"
9+
args = "yarn"
10+
}
11+
12+
action "Deployment" {
13+
needs = "Installation"
14+
uses = "./.github/actions-node/"
15+
args = "yarn deploy"
16+
secrets = ["GITHUB_TOKEN"]
17+
}
18+
19+
# Filter for 1.0 branch
20+
action "Filters for GitHub Actions" {
21+
uses = "actions/bin/filter@3c0b4f0e63ea54ea5df2914b4fabf383368cd0da"
22+
secrets = ["GITHUB_TOKEN"]
23+
args = "branch 1.0"
24+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
checklist
22
node_modules/
33
yarn.lock
4+
run/

config.js

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
module.exports = {
2+
clearScreen: false,
3+
siteConfig: {
4+
title: 'Egg',
5+
host: '0.0.0.0',
6+
description: 'Egg 文档',
7+
evergreen: true,
8+
locales: {
9+
'/': {
10+
lang: 'en-US',
11+
title: 'Egg',
12+
description:
13+
'Born to build better enterprise frameworks and apps with Node.js & Koa',
14+
},
15+
'/zh/': {
16+
lang: 'zh-CN',
17+
title: 'Egg',
18+
description: '为企业级框架和应用而生',
19+
},
20+
},
21+
markdown: {
22+
lineNumbers: true,
23+
},
24+
devServer: {
25+
overlay: {
26+
// warnings: true,
27+
errors: true,
28+
},
29+
},
30+
themeConfig: {
31+
locales: {
32+
'/': {
33+
selectText: 'Languages',
34+
label: 'English',
35+
editLinkText: 'Edit this page on GitHub',
36+
serviceWorker: {
37+
updatePopup: {
38+
message: 'New content is available.',
39+
buttonText: 'Refresh',
40+
},
41+
},
42+
nav: [
43+
{ text: 'Home', link: '/' },
44+
{ text: 'QuickStart', link: '/quickstart/' },
45+
{ text: 'Guide', link: '/guide/' },
46+
],
47+
sidebar: {
48+
'/quickstart/': [['./', 'QuickStart'], 'egg'],
49+
50+
'/guide/': [
51+
['./', 'Description'],
52+
// 'directory',
53+
// 'middleware',
54+
// 'controller',
55+
// 'router',
56+
// 'service',
57+
// 'application',
58+
// 'context',
59+
// 'config',
60+
// 'logger',
61+
// 'cookie',
62+
// 'session',
63+
// 'helper',
64+
// 'httpclient',
65+
// 'error_handler',
66+
// 'lifecycle',
67+
// 'plugin',
68+
// 'upload',
69+
// 'i18n',
70+
],
71+
},
72+
},
73+
'/zh/': {
74+
selectText: '选择语言',
75+
label: '简体中文',
76+
editLinkText: '在 GitHub 上编辑此页',
77+
serviceWorker: {
78+
updatePopup: {
79+
message: '发现新内容可用.',
80+
buttonText: '刷新',
81+
},
82+
},
83+
nav: [
84+
{ text: '首页', link: '/zh/' },
85+
{ text: '快速开始', link: '/zh/quickstart/' },
86+
{ text: '教程', link: '/zh/guide/' },
87+
],
88+
sidebar: {
89+
'/zh/quickstart/': [['./', '快速开始'], 'egg'],
90+
91+
'/zh/guide/': [
92+
['./', '概述'],
93+
'directory',
94+
'middleware',
95+
'controller',
96+
'router',
97+
'service',
98+
'application',
99+
'context',
100+
'config',
101+
'logger',
102+
'cookie',
103+
'session',
104+
'helper',
105+
'httpclient',
106+
'error_handler',
107+
'lifecycle',
108+
'plugin',
109+
'upload',
110+
'i18n',
111+
],
112+
},
113+
},
114+
},
115+
},
116+
},
117+
};

docs/.vuepress/config.js

Lines changed: 0 additions & 122 deletions
This file was deleted.

docs/quickstart/egg.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Simple Egg Application
3+
---

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"dev": "vuepress dev docs",
8-
"build": "vuepress build docs"
7+
"dev": "doctools dev --configPath config.js",
8+
"build": "doctools build --configPath config.js",
9+
"deploy": "doctools deploy --configPath config.js --githubToken=true"
910
},
1011
"repository": {
1112
"type": "git",
@@ -18,6 +19,9 @@
1819
},
1920
"homepage": "https://github.com/eggjs/eggjs.github.io#readme",
2021
"dependencies": {
21-
"vuepress": "^1.0.0-alpha.47"
22+
"@eggjs/doctools": "^1.0.7"
23+
},
24+
"devDependencies": {
25+
"chokidar": "^3.0.2"
2226
}
2327
}

0 commit comments

Comments
 (0)