react-docs-ui 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/react-docs-ui.css +1 -1
- package/dist/react-docs-ui.es.js +6642 -6320
- package/package.json +16 -16
- package/dist/config/ai.json +0 -60
- package/dist/config/site.en.yaml +0 -137
- package/dist/config/site.yaml +0 -137
- package/dist/docs/en/guide/configuration.md +0 -149
- package/dist/docs/en/guide/installation.md +0 -63
- package/dist/docs/en/guide/introduction.md +0 -28
- package/dist/docs/en/guide/quick-start.md +0 -108
- package/dist/docs/en/guide.md +0 -10
- package/dist/docs/en/index.md +0 -34
- package/dist/docs/zh-cn/guide/configuration.md +0 -207
- package/dist/docs/zh-cn/guide/installation.md +0 -63
- package/dist/docs/zh-cn/guide/introduction.md +0 -28
- package/dist/docs/zh-cn/guide/quick-start.md +0 -108
- package/dist/docs/zh-cn/guide.md +0 -10
- package/dist/docs/zh-cn/index.md +0 -34
- package/dist/images/favicon-dark.svg +0 -7
- package/dist/images/favicon.svg +0 -7
- package/dist/images/placeholder.md +0 -25
- package/dist/react-docs-ui.es.js.map +0 -1
- package/dist/react-docs-ui.umd.js +0 -202
- package/dist/react-docs-ui.umd.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-docs-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React documentation site UI components — navigation, sidebar, search, code highlight, MDX rendering and theming to help you build docs fast.",
|
|
6
6
|
"homepage": "https://shenjianZ.github.io/react-docs-ui",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"documentation-site",
|
|
17
17
|
"typescript"
|
|
18
18
|
],
|
|
19
|
-
"main": "dist/react-docs-ui.umd.js",
|
|
20
19
|
"module": "dist/react-docs-ui.es.js",
|
|
21
20
|
"types": "dist/types/index.d.ts",
|
|
22
21
|
"files": [
|
|
@@ -26,8 +25,8 @@
|
|
|
26
25
|
],
|
|
27
26
|
"exports": {
|
|
28
27
|
".": {
|
|
29
|
-
"
|
|
30
|
-
"
|
|
28
|
+
"types": "./dist/types/index.d.ts",
|
|
29
|
+
"import": "./dist/react-docs-ui.es.js"
|
|
31
30
|
},
|
|
32
31
|
"./dist/react-docs-ui.css": "./dist/react-docs-ui.css"
|
|
33
32
|
},
|
|
@@ -47,32 +46,29 @@
|
|
|
47
46
|
"@radix-ui/react-scroll-area": "^1.2.9",
|
|
48
47
|
"@radix-ui/react-slot": "^1.2.3",
|
|
49
48
|
"@radix-ui/react-tooltip": "^1.2.7",
|
|
50
|
-
"@tailwindcss/vite": "^4.1.11",
|
|
51
|
-
"buffer": "^6.0.3",
|
|
52
49
|
"class-variance-authority": "^0.7.1",
|
|
53
50
|
"clsx": "^2.1.1",
|
|
54
51
|
"cmdk": "^1.1.1",
|
|
55
|
-
"glob": "^11.0.3",
|
|
56
52
|
"gray-matter": "^4.0.3",
|
|
57
53
|
"js-yaml": "^4.1.0",
|
|
58
|
-
"lowlight": "^3.3.0",
|
|
59
54
|
"lucide-react": "^0.539.0",
|
|
60
55
|
"next-themes": "^0.4.6",
|
|
61
|
-
"react": ">=18",
|
|
62
|
-
"react-dom": ">=18",
|
|
63
56
|
"react-markdown": "^10.1.0",
|
|
64
|
-
"react-router-dom": "^7.8.0",
|
|
65
57
|
"rehype-autolink-headings": "^7.1.0",
|
|
66
58
|
"rehype-highlight": "^7.0.2",
|
|
67
|
-
"rehype-pretty-code": "^0.14.1",
|
|
68
59
|
"rehype-raw": "^7.0.0",
|
|
69
60
|
"rehype-slug": "^6.0.0",
|
|
70
61
|
"remark-gfm": "^4.0.1",
|
|
71
|
-
"
|
|
72
|
-
"tailwind-merge": "^3.3.1",
|
|
73
|
-
"tailwindcss": "^4.1.11"
|
|
62
|
+
"tailwind-merge": "^3.3.1"
|
|
74
63
|
},
|
|
75
64
|
"devDependencies": {
|
|
65
|
+
"react": "^19.0.0",
|
|
66
|
+
"react-dom": "^19.0.0",
|
|
67
|
+
"buffer": "^6.0.3",
|
|
68
|
+
"glob": "^11.0.3",
|
|
69
|
+
"@tailwindcss/vite": "^4.1.11",
|
|
70
|
+
"react-router-dom": "^7.8.0",
|
|
71
|
+
"tailwindcss": "^4.1.11",
|
|
76
72
|
"@eslint/js": "^9.32.0",
|
|
77
73
|
"@types/node": "^24.2.1",
|
|
78
74
|
"@types/react": "^19.1.9",
|
|
@@ -91,6 +87,10 @@
|
|
|
91
87
|
},
|
|
92
88
|
"peerDependencies": {
|
|
93
89
|
"react": ">=18",
|
|
94
|
-
"react-dom": ">=18"
|
|
90
|
+
"react-dom": ">=18",
|
|
91
|
+
"react-router-dom": "^7"
|
|
92
|
+
},
|
|
93
|
+
"engines": {
|
|
94
|
+
"node": ">=18"
|
|
95
95
|
}
|
|
96
96
|
}
|
package/dist/config/ai.json
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"enabled": true,
|
|
3
|
-
"provider": "openai",
|
|
4
|
-
"systemPrompt": "你是一个专业的文档助手,请根据用户的问题,提供准确的答案。",
|
|
5
|
-
"models": {
|
|
6
|
-
"openai": {
|
|
7
|
-
"modelId": "gpt-3.5-turbo",
|
|
8
|
-
"apiKey": "",
|
|
9
|
-
"baseUrl": "https://api.openai.com/v1",
|
|
10
|
-
"maxTokens": 4000,
|
|
11
|
-
"temperature": 0.7
|
|
12
|
-
},
|
|
13
|
-
"claude": {
|
|
14
|
-
"modelId": "claude-3-sonnet-20240229",
|
|
15
|
-
"apiKey": "",
|
|
16
|
-
"baseUrl": "https://api.anthropic.com",
|
|
17
|
-
"maxTokens": 4000,
|
|
18
|
-
"temperature": 0.7
|
|
19
|
-
},
|
|
20
|
-
"gemini": {
|
|
21
|
-
"modelId": "gemini-pro",
|
|
22
|
-
"apiKey": "",
|
|
23
|
-
"baseUrl": "https://generativelanguage.googleapis.com/v1",
|
|
24
|
-
"maxTokens": 4000,
|
|
25
|
-
"temperature": 0.7
|
|
26
|
-
},
|
|
27
|
-
"deepseek-v3": {
|
|
28
|
-
"modelId": "deepseek-chat",
|
|
29
|
-
"apiKey": "",
|
|
30
|
-
"baseUrl": "https://api.deepseek.com",
|
|
31
|
-
"maxTokens": 4000,
|
|
32
|
-
"temperature": 0.7
|
|
33
|
-
},
|
|
34
|
-
"deepseek-reasoner": {
|
|
35
|
-
"modelId": "deepseek-reasoner",
|
|
36
|
-
"apiKey": "",
|
|
37
|
-
"baseUrl": "https://api.deepseek.com",
|
|
38
|
-
"maxTokens": 4000,
|
|
39
|
-
"temperature": 0.7
|
|
40
|
-
},
|
|
41
|
-
"custom": {
|
|
42
|
-
"modelId": "",
|
|
43
|
-
"apiKey": "",
|
|
44
|
-
"baseUrl": "",
|
|
45
|
-
"maxTokens": 4000,
|
|
46
|
-
"temperature": 0.7
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"features": {
|
|
50
|
-
"chatAssistant": true,
|
|
51
|
-
"documentSummary": true,
|
|
52
|
-
"codeExplanation": true,
|
|
53
|
-
"searchEnhancement": false
|
|
54
|
-
},
|
|
55
|
-
"ui": {
|
|
56
|
-
"position": "bottom-right",
|
|
57
|
-
"theme": "auto",
|
|
58
|
-
"size": "medium"
|
|
59
|
-
}
|
|
60
|
-
}
|
package/dist/config/site.en.yaml
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# Website Configuration
|
|
2
|
-
site:
|
|
3
|
-
title: "React Docs UI Example"
|
|
4
|
-
description: "Example documentation website built with React Docs UI"
|
|
5
|
-
# Logo formats supported:
|
|
6
|
-
# 1. emoji: "🤖"
|
|
7
|
-
# 2. image URL: "https://example.com/logo.png"
|
|
8
|
-
# 3. local image: "/images/logo.png"
|
|
9
|
-
# 4. relative path: "./assets/logo.svg"
|
|
10
|
-
logo:
|
|
11
|
-
light: "/images/favicon.svg"
|
|
12
|
-
dark: "/images/favicon-dark.svg"
|
|
13
|
-
author: "React Docs UI Team"
|
|
14
|
-
|
|
15
|
-
# Navigation Bar Configuration
|
|
16
|
-
navbar:
|
|
17
|
-
showLogo: true
|
|
18
|
-
showTitle: true
|
|
19
|
-
showLanguageSwitcher: true
|
|
20
|
-
items:
|
|
21
|
-
- title: "Home"
|
|
22
|
-
link: "/"
|
|
23
|
-
active: true
|
|
24
|
-
- title: "Guide"
|
|
25
|
-
link: "/guide"
|
|
26
|
-
actions:
|
|
27
|
-
- type: "github"
|
|
28
|
-
link: "https://github.com/shenjianZ/React-docs-ui"
|
|
29
|
-
enabled: true
|
|
30
|
-
|
|
31
|
-
# Sidebar Navigation Configuration
|
|
32
|
-
sidebar:
|
|
33
|
-
enabled: true
|
|
34
|
-
collections:
|
|
35
|
-
guide:
|
|
36
|
-
sections:
|
|
37
|
-
- title: "Getting Started"
|
|
38
|
-
path: "/guide"
|
|
39
|
-
children:
|
|
40
|
-
- title: "Introduction"
|
|
41
|
-
path: "/guide/introduction"
|
|
42
|
-
- title: "Installation"
|
|
43
|
-
path: "/guide/installation"
|
|
44
|
-
- title: "Quick Start"
|
|
45
|
-
path: "/guide/quick-start"
|
|
46
|
-
- title: "Configuration"
|
|
47
|
-
path: "/guide/configuration"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
# Theme Configuration
|
|
51
|
-
theme:
|
|
52
|
-
# Default theme mode: 'light' | 'dark' | 'auto'
|
|
53
|
-
# light: Force light mode
|
|
54
|
-
# dark: Force dark mode
|
|
55
|
-
# auto: Follow system preference (default)
|
|
56
|
-
defaultMode: "auto"
|
|
57
|
-
|
|
58
|
-
# Allow users to toggle theme (show theme toggle button)
|
|
59
|
-
allowToggle: true
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# Table of Contents Configuration
|
|
63
|
-
toc:
|
|
64
|
-
# Maximum heading level to display in TOC (1-6)
|
|
65
|
-
maxLevel: 3
|
|
66
|
-
|
|
67
|
-
# Enable table of contents
|
|
68
|
-
enabled: true
|
|
69
|
-
|
|
70
|
-
# TOC title
|
|
71
|
-
title: "On This Page"
|
|
72
|
-
|
|
73
|
-
# Footer Configuration
|
|
74
|
-
footer:
|
|
75
|
-
enabled: true
|
|
76
|
-
copyright: "© 2024 React Docs UI. All rights reserved."
|
|
77
|
-
repository:
|
|
78
|
-
url: "https://github.com/your_github_id/your_repo_name"
|
|
79
|
-
branch: "master"
|
|
80
|
-
lastUpdated: "2024-12-19"
|
|
81
|
-
links:
|
|
82
|
-
- title: "Documentation"
|
|
83
|
-
link: "/guide/introduction"
|
|
84
|
-
- title: "GitHub"
|
|
85
|
-
link: "https://github.com/your_github_id/your_repo_name"
|
|
86
|
-
external: true
|
|
87
|
-
- title: "License"
|
|
88
|
-
link: "/license"
|
|
89
|
-
social:
|
|
90
|
-
- name: "email"
|
|
91
|
-
url: "mailto:contact@example.com"
|
|
92
|
-
icon: "mail"
|
|
93
|
-
- name: "github"
|
|
94
|
-
url: "https://github.com/your_github_id"
|
|
95
|
-
icon: "github"
|
|
96
|
-
# - name: "youtube"
|
|
97
|
-
# url: "https://youtube.com/@yourhandle"
|
|
98
|
-
# icon: "youtube"
|
|
99
|
-
# - name: "twitter"
|
|
100
|
-
# url: "https://twitter.com/yourhandle"
|
|
101
|
-
# icon: "twitter"
|
|
102
|
-
# - name: "discord"
|
|
103
|
-
# url: "https://discord.gg/yourinvite"
|
|
104
|
-
# icon: "discord"
|
|
105
|
-
# - name: "telegram"
|
|
106
|
-
# url: "https://t.me/yourhandle"
|
|
107
|
-
# icon: "telegram"
|
|
108
|
-
# - name: "tiktok"
|
|
109
|
-
# url: "https://tiktok.com/@yourhandle"
|
|
110
|
-
# icon: "tiktok"
|
|
111
|
-
- name: "bilibili"
|
|
112
|
-
url: "https://space.bilibili.com/your_bilibili_id"
|
|
113
|
-
icon: "bilibili"
|
|
114
|
-
- name: "qq"
|
|
115
|
-
url: "mqqapi://card/show_pslcard?src_type=internal&version=1&uin=your_qq_id&card_type=person&source=qrcode"
|
|
116
|
-
icon: "qq"
|
|
117
|
-
- name: "wechat"
|
|
118
|
-
url: "weixin://dl/add?your_wechat_id"
|
|
119
|
-
icon: "wechat"
|
|
120
|
-
# - name: "weibo"
|
|
121
|
-
# url: "https://weibo.com/yourhandle"
|
|
122
|
-
# icon: "weibo"
|
|
123
|
-
# - name: "douyin"
|
|
124
|
-
# url: "https://www.douyin.com/user/yourhandle"
|
|
125
|
-
# icon: "douyin"
|
|
126
|
-
# - name: "zhihu"
|
|
127
|
-
# url: "https://www.zhihu.com/people/yourhandle"
|
|
128
|
-
# icon: "zhihu"
|
|
129
|
-
|
|
130
|
-
# PWA Configuration
|
|
131
|
-
pwa:
|
|
132
|
-
enabled: false
|
|
133
|
-
name: "React Docs UI"
|
|
134
|
-
shortName: "ReactDocsUI"
|
|
135
|
-
description: "Beautiful documentation websites made simple"
|
|
136
|
-
themeColor: "#ffffff"
|
|
137
|
-
backgroundColor: "#ffffff"
|
package/dist/config/site.yaml
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# 网站基本配置
|
|
2
|
-
site:
|
|
3
|
-
title: "React Docs UI 示例项目"
|
|
4
|
-
description: "基于 React Docs UI 构建的文档网站示例"
|
|
5
|
-
# logo支持以下格式:
|
|
6
|
-
# 1. emoji: "🤖"
|
|
7
|
-
# 2. 图片URL: "https://example.com/logo.png"
|
|
8
|
-
# 3. 本地图片: "/images/logo.png"
|
|
9
|
-
# 4. 相对路径: "./assets/logo.svg"
|
|
10
|
-
logo:
|
|
11
|
-
light: "/images/favicon.svg"
|
|
12
|
-
dark: "/images/favicon-dark.svg"
|
|
13
|
-
author: "React Docs UI Team"
|
|
14
|
-
|
|
15
|
-
# 顶部导航配置
|
|
16
|
-
navbar:
|
|
17
|
-
showLogo: true
|
|
18
|
-
showTitle: true
|
|
19
|
-
showLanguageSwitcher: true
|
|
20
|
-
items:
|
|
21
|
-
- title: "首页"
|
|
22
|
-
link: "/"
|
|
23
|
-
active: true
|
|
24
|
-
- title: "指南"
|
|
25
|
-
link: "/guide"
|
|
26
|
-
actions:
|
|
27
|
-
- type: "github"
|
|
28
|
-
link: "https://github.com/shenjianZ/React-docs-ui"
|
|
29
|
-
enabled: true
|
|
30
|
-
|
|
31
|
-
# 侧边栏导航配置
|
|
32
|
-
sidebar:
|
|
33
|
-
enabled: true
|
|
34
|
-
collections:
|
|
35
|
-
guide:
|
|
36
|
-
sections:
|
|
37
|
-
- title: "快速开始"
|
|
38
|
-
path: "/guide"
|
|
39
|
-
children:
|
|
40
|
-
- title: "介绍"
|
|
41
|
-
path: "/guide/introduction"
|
|
42
|
-
- title: "安装"
|
|
43
|
-
path: "/guide/installation"
|
|
44
|
-
- title: "快速上手"
|
|
45
|
-
path: "/guide/quick-start"
|
|
46
|
-
- title: "配置说明"
|
|
47
|
-
path: "/guide/configuration"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
# Theme Configuration
|
|
51
|
-
theme:
|
|
52
|
-
# Default theme mode: 'light' | 'dark' | 'auto'
|
|
53
|
-
# light: Force light mode
|
|
54
|
-
# dark: Force dark mode
|
|
55
|
-
# auto: Follow system preference (default)
|
|
56
|
-
defaultMode: "auto"
|
|
57
|
-
|
|
58
|
-
# Allow users to toggle theme (show theme toggle button)
|
|
59
|
-
allowToggle: true
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# Table of Contents Configuration
|
|
63
|
-
toc:
|
|
64
|
-
# Maximum heading level to display in TOC (1-6)
|
|
65
|
-
maxLevel: 3
|
|
66
|
-
|
|
67
|
-
# Enable table of contents
|
|
68
|
-
enabled: true
|
|
69
|
-
|
|
70
|
-
# TOC title
|
|
71
|
-
title: "本页目录"
|
|
72
|
-
|
|
73
|
-
# Footer Configuration
|
|
74
|
-
footer:
|
|
75
|
-
enabled: true
|
|
76
|
-
copyright: "© 2024 React Docs UI. All rights reserved."
|
|
77
|
-
repository:
|
|
78
|
-
url: "https://github.com/your_github_id/your_repo_name"
|
|
79
|
-
branch: "master"
|
|
80
|
-
lastUpdated: "2024-12-19"
|
|
81
|
-
links:
|
|
82
|
-
- title: "Documentation"
|
|
83
|
-
link: "/guide/introduction"
|
|
84
|
-
- title: "GitHub"
|
|
85
|
-
link: "https://github.com/your_github_id/your_repo_name"
|
|
86
|
-
external: true
|
|
87
|
-
- title: "License"
|
|
88
|
-
link: "/license"
|
|
89
|
-
social:
|
|
90
|
-
- name: "email"
|
|
91
|
-
url: "mailto:contact@example.com"
|
|
92
|
-
icon: "mail"
|
|
93
|
-
- name: "github"
|
|
94
|
-
url: "https://github.com/your_github_id"
|
|
95
|
-
icon: "github"
|
|
96
|
-
# - name: "youtube"
|
|
97
|
-
# url: "https://youtube.com/@yourhandle"
|
|
98
|
-
# icon: "youtube"
|
|
99
|
-
# - name: "twitter"
|
|
100
|
-
# url: "https://twitter.com/yourhandle"
|
|
101
|
-
# icon: "twitter"
|
|
102
|
-
# - name: "discord"
|
|
103
|
-
# url: "https://discord.gg/yourinvite"
|
|
104
|
-
# icon: "discord"
|
|
105
|
-
# - name: "telegram"
|
|
106
|
-
# url: "https://t.me/yourhandle"
|
|
107
|
-
# icon: "telegram"
|
|
108
|
-
# - name: "tiktok"
|
|
109
|
-
# url: "https://tiktok.com/@yourhandle"
|
|
110
|
-
# icon: "tiktok"
|
|
111
|
-
- name: "bilibili"
|
|
112
|
-
url: "https://space.bilibili.com/your_bilibili_id"
|
|
113
|
-
icon: "bilibili"
|
|
114
|
-
- name: "qq"
|
|
115
|
-
url: "mqqapi://card/show_pslcard?src_type=internal&version=1&uin=your_qq_id&card_type=person&source=qrcode"
|
|
116
|
-
icon: "qq"
|
|
117
|
-
- name: "wechat"
|
|
118
|
-
url: "weixin://dl/add?your_wechat_id"
|
|
119
|
-
icon: "wechat"
|
|
120
|
-
# - name: "weibo"
|
|
121
|
-
# url: "https://weibo.com/yourhandle"
|
|
122
|
-
# icon: "weibo"
|
|
123
|
-
# - name: "douyin"
|
|
124
|
-
# url: "https://www.douyin.com/user/yourhandle"
|
|
125
|
-
# icon: "douyin"
|
|
126
|
-
# - name: "zhihu"
|
|
127
|
-
# url: "https://www.zhihu.com/people/yourhandle"
|
|
128
|
-
# icon: "zhihu"
|
|
129
|
-
|
|
130
|
-
# PWA Configuration
|
|
131
|
-
pwa:
|
|
132
|
-
enabled: true
|
|
133
|
-
name: "React Docs UI"
|
|
134
|
-
shortName: "ReactDocsUI"
|
|
135
|
-
description: "Beautiful documentation websites made simple"
|
|
136
|
-
themeColor: "#ffffff"
|
|
137
|
-
backgroundColor: "#ffffff"
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
# Configuration File (`site.yaml`) Explained
|
|
2
|
-
|
|
3
|
-
The project is configuration-driven. Most behavior is defined in `public/config/site.yaml`. This page documents every field using concise tables.
|
|
4
|
-
|
|
5
|
-
## Top-level keys
|
|
6
|
-
| Key | Purpose |
|
|
7
|
-
| :-- | :-- |
|
|
8
|
-
| `site` | Global metadata like title, description, logo, author |
|
|
9
|
-
| `navbar` | Top navigation bar (logo/title toggles, items, actions) |
|
|
10
|
-
| `sidebar` | Left navigation tree (collections/sections/children) |
|
|
11
|
-
| `theme` | Theme options (default mode, toggle) |
|
|
12
|
-
| `toc` | Article table of contents (enabled, levels, title) |
|
|
13
|
-
| `footer` | Footer links, socials, repository meta |
|
|
14
|
-
| `pwa` | Progressive Web App settings (reserved/optional) |
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## `site`
|
|
19
|
-
| Field | Type | Description | Example |
|
|
20
|
-
| :-- | :-- | :-- | :-- |
|
|
21
|
-
| `title` | string | Site title | `"React Docs UI Example"` |
|
|
22
|
-
| `description` | string | Short site description (SEO) | `"Beautiful docs made simple"` |
|
|
23
|
-
| `logo` | string or object | Logo to display. String can be emoji or image path. Object allows light/dark images. | `"📚"`, `"/images/logo.png"`, or `{ light: "/images/favicon.svg", dark: "/images/favicon-dark.svg" }` |
|
|
24
|
-
| `author` | string | Site author/organization | `"React Docs UI Team"` |
|
|
25
|
-
|
|
26
|
-
Logo formats supported:
|
|
27
|
-
- Emoji: `"🚀"`
|
|
28
|
-
- URL or public path: `"/images/logo.png"`
|
|
29
|
-
- Light/Dark object: `{ light, dark }`
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## `navbar`
|
|
34
|
-
| Field | Type | Description |
|
|
35
|
-
| :-- | :-- | :-- |
|
|
36
|
-
| `showLogo` | boolean | Show logo at top-left |
|
|
37
|
-
| `showTitle` | boolean | Show site title in navbar |
|
|
38
|
-
| `showLanguageSwitcher` | boolean | Show language switcher |
|
|
39
|
-
| `items` | array<Item> | Primary navigation links |
|
|
40
|
-
| `actions` | array<Action> | Right-side action buttons (e.g. GitHub) |
|
|
41
|
-
|
|
42
|
-
Item
|
|
43
|
-
| Field | Type | Description | Example |
|
|
44
|
-
| :-- | :-- | :-- | :-- |
|
|
45
|
-
| `title` | string | Link text | `"Guide"` |
|
|
46
|
-
| `link` | string | Path or URL. Internal paths start with `/`. | `"/guide"` |
|
|
47
|
-
| `external` | boolean (optional) | Open in new tab if true |
|
|
48
|
-
| `visible` | boolean (optional) | Conditionally hide/show |
|
|
49
|
-
|
|
50
|
-
Action
|
|
51
|
-
| Field | Type | Description | Example |
|
|
52
|
-
| :-- | :-- | :-- | :-- |
|
|
53
|
-
| `type` | `"github"` or `"custom"` (optional) | Predefined or custom action | `"github"` |
|
|
54
|
-
| `title` | string (optional) | Button text when `type` is `custom` |
|
|
55
|
-
| `link` | string | Destination URL |
|
|
56
|
-
| `icon` | string (optional) | Icon name for custom action |
|
|
57
|
-
| `enabled` | boolean (optional) | Toggle the action |
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## `sidebar`
|
|
62
|
-
| Field | Type | Description |
|
|
63
|
-
| :-- | :-- | :-- |
|
|
64
|
-
| `enabled` | boolean (optional) | Global toggle for sidebar |
|
|
65
|
-
| `collections` | record<string, Collection> | Map of top-level sections (e.g. `guide`) |
|
|
66
|
-
| `sections` | Section[] (legacy, optional) | Backward-compatible single-tree definition |
|
|
67
|
-
|
|
68
|
-
Collection
|
|
69
|
-
| Field | Type | Description |
|
|
70
|
-
| :-- | :-- | :-- |
|
|
71
|
-
| `sections` | Section[] | Grouped side-nav sections |
|
|
72
|
-
|
|
73
|
-
Section
|
|
74
|
-
| Field | Type | Description | Example |
|
|
75
|
-
| :-- | :-- | :-- | :-- |
|
|
76
|
-
| `title` | string | Section title | `"Getting Started"` |
|
|
77
|
-
| `path` | string | Base path that expands/highlights this section | `"/guide"` |
|
|
78
|
-
| `children` | Child[] (optional) | Leaf links under the section |
|
|
79
|
-
|
|
80
|
-
Child
|
|
81
|
-
| Field | Type | Description | Example |
|
|
82
|
-
| :-- | :-- | :-- | :-- |
|
|
83
|
-
| `title` | string | Link text | `"Introduction"` |
|
|
84
|
-
| `path` | string | Full page path | `"/guide/introduction"` |
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## `theme`
|
|
89
|
-
| Field | Type | Description | Options | Default |
|
|
90
|
-
| :-- | :-- | :-- | :-- | :-- |
|
|
91
|
-
| `defaultMode` | string | Default color mode | `light`, `dark`, `auto` | `auto` |
|
|
92
|
-
| `allowToggle` | boolean | Allow user theme switching | `true`/`false` | `true` |
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## `toc`
|
|
97
|
-
| Field | Type | Description | Example |
|
|
98
|
-
| :-- | :-- | :-- | :-- |
|
|
99
|
-
| `enabled` | boolean | Enable page table of contents | `true` |
|
|
100
|
-
| `maxLevel` | number (1-6) | Max heading depth to show | `3` |
|
|
101
|
-
| `title` | string | TOC panel title | `"On This Page"` |
|
|
102
|
-
|
|
103
|
-
Note: Per-page TOC visibility/anchors are also affected by page frontmatter.
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## `footer`
|
|
108
|
-
| Field | Type | Description |
|
|
109
|
-
| :-- | :-- | :-- |
|
|
110
|
-
| `enabled` | boolean | Show footer |
|
|
111
|
-
| `copyright` | string | Copyright text |
|
|
112
|
-
| `repository` | Repository (optional) | Repo info used for links like “Edit this page” |
|
|
113
|
-
| `lastUpdated` | string (optional) | Site/content last update date |
|
|
114
|
-
| `links` | Link[] (optional) | Footer link columns |
|
|
115
|
-
| `social` | Social[] (optional) | Social icon links |
|
|
116
|
-
|
|
117
|
-
Repository
|
|
118
|
-
| Field | Type | Description | Example |
|
|
119
|
-
| :-- | :-- | :-- | :-- |
|
|
120
|
-
| `url` | string | Repository URL | `"https://github.com/user/repo"` |
|
|
121
|
-
| `branch` | string | Docs branch | `"main"` |
|
|
122
|
-
|
|
123
|
-
Link
|
|
124
|
-
| Field | Type | Description |
|
|
125
|
-
| :-- | :-- | :-- |
|
|
126
|
-
| `title` | string | Link title |
|
|
127
|
-
| `link` | string | Path or URL |
|
|
128
|
-
| `external` | boolean (optional) | Open in new tab |
|
|
129
|
-
|
|
130
|
-
Social
|
|
131
|
-
| Field | Type | Description |
|
|
132
|
-
| :-- | :-- | :-- |
|
|
133
|
-
| `name` | string | Provider key (e.g. `github`, `twitter`, `bilibili`) |
|
|
134
|
-
| `url` | string | Profile or link URL |
|
|
135
|
-
| `icon` | string | Icon name |
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## `pwa` (optional)
|
|
140
|
-
| Field | Type | Description |
|
|
141
|
-
| :-- | :-- | :-- |
|
|
142
|
-
| `enabled` | boolean | Enable PWA features (reserved) |
|
|
143
|
-
| `name` | string | App name |
|
|
144
|
-
| `shortName` | string | Short app name |
|
|
145
|
-
| `description` | string | App description |
|
|
146
|
-
| `themeColor` | string | Theme color |
|
|
147
|
-
| `backgroundColor` | string | Background color |
|
|
148
|
-
|
|
149
|
-
---
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Installation
|
|
2
|
-
|
|
3
|
-
## Prerequisites
|
|
4
|
-
|
|
5
|
-
Before you begin, make sure your development environment meets the following requirements:
|
|
6
|
-
|
|
7
|
-
- **Node.js**: Version `>= 18.0.0`
|
|
8
|
-
- **Package Manager**: `npm`, `yarn`, or `pnpm`
|
|
9
|
-
|
|
10
|
-
## Recommended Method: Use the Scaffolding Tool
|
|
11
|
-
|
|
12
|
-
We strongly recommend using the official `create-react-docs-ui` scaffolding tool to create your new documentation project. This is the fastest and easiest way to ensure all configurations are set up correctly.
|
|
13
|
-
|
|
14
|
-
1. **Run the creation command**:
|
|
15
|
-
```bash
|
|
16
|
-
npx create-react-docs-ui@latest my-docs
|
|
17
|
-
```
|
|
18
|
-
This will create a new folder named `my-docs` in the current directory.
|
|
19
|
-
|
|
20
|
-
2. **Enter the project and install dependencies**:
|
|
21
|
-
```bash
|
|
22
|
-
cd my-docs
|
|
23
|
-
npm install
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
3. **Start the development server**:
|
|
27
|
-
```bash
|
|
28
|
-
npm run dev
|
|
29
|
-
```
|
|
30
|
-
Your documentation website is now running at `http://localhost:5173` (or another available port).
|
|
31
|
-
|
|
32
|
-
## Manual Installation (for existing projects)
|
|
33
|
-
|
|
34
|
-
If you want to manually integrate `react-docs-ui` into an existing Vite + React project, follow these steps:
|
|
35
|
-
|
|
36
|
-
1. **Install the core library**:
|
|
37
|
-
```bash
|
|
38
|
-
npm install react-docs-ui
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
2. **Create configuration files**:
|
|
42
|
-
In your `public` directory, create a `config` folder, and inside it, create a `site.yaml` file. You can copy a basic template from [here](https://github.com/shenjianZ/react-docs-ui/blob/main/react-docs-ui/public/config/site.yaml).
|
|
43
|
-
|
|
44
|
-
3. **Create the documentation directory**:
|
|
45
|
-
In your `public` directory, create a `docs` folder to store your Markdown files. For example: `public/docs/en/index.md`.
|
|
46
|
-
|
|
47
|
-
4. **Modify the application entry file**:
|
|
48
|
-
Update your `src/main.tsx` (or `main.jsx`) file to render the `DocsApp` component to initialize the application.
|
|
49
|
-
|
|
50
|
-
```tsx
|
|
51
|
-
// src/main.tsx
|
|
52
|
-
import React from 'react'
|
|
53
|
-
import ReactDOM from 'react-dom/client'
|
|
54
|
-
import { DocsApp } from 'react-docs-ui'
|
|
55
|
-
import 'react-docs-ui/dist/style.css' // Import core styles
|
|
56
|
-
|
|
57
|
-
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
58
|
-
<React.StrictMode>
|
|
59
|
-
<DocsApp />
|
|
60
|
-
</React.StrictMode>,
|
|
61
|
-
)
|
|
62
|
-
```
|
|
63
|
-
5. **Ensure your `index.html` contains `<div id="root"></div>`**
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Introduction
|
|
2
|
-
|
|
3
|
-
React Docs UI is a React component library and toolset designed specifically for building modern documentation websites. Its core philosophy is **configuration over code**, allowing you to focus entirely on content creation.
|
|
4
|
-
|
|
5
|
-
## Core Advantages
|
|
6
|
-
|
|
7
|
-
- **Configuration-Driven**: This is the core feature of React Docs UI. You don't need to write complex React components or routing logic; just maintain a clear `site.yaml` file to define everything from the site's navigation and sidebar to its theme and footer.
|
|
8
|
-
|
|
9
|
-
- **Fully-Featured**: Out-of-the-box, it provides everything a modern documentation website needs:
|
|
10
|
-
- Responsive layout
|
|
11
|
-
- Light/dark theme switching
|
|
12
|
-
- Markdown-based content rendering (with GFM and Frontmatter support)
|
|
13
|
-
- Built-in code syntax highlighting
|
|
14
|
-
- Quick command menu (Cmd+K)
|
|
15
|
-
- Internationalization support
|
|
16
|
-
|
|
17
|
-
- **Extremely Simple to Start**: With the official `create-react-docs-ui` scaffolding tool, you can launch a fully functional documentation website in under a minute, without any complex environment setup.
|
|
18
|
-
|
|
19
|
-
- **Highly Customizable**: While it works out-of-the-box, every part (like the logo, color scheme, navigation links, social media icons, etc.) can be deeply customized through the configuration file.
|
|
20
|
-
|
|
21
|
-
## Use Cases
|
|
22
|
-
|
|
23
|
-
Whether you are an individual developer or part of a team, React Docs UI is perfect for the following scenarios:
|
|
24
|
-
|
|
25
|
-
- **Open Source Project Documentation**: Provide a professional and easy-to-maintain documentation site for your React project.
|
|
26
|
-
- **Product Manuals**: Clearly present your product's features and usage guides.
|
|
27
|
-
- **Team Knowledge Bases**: Build and share knowledge based on React technology within your team.
|
|
28
|
-
- **Personal Blogs or Portfolios**: Organize and display your technical articles or projects in an elegant way.
|