create-react-docs-ui 0.2.0 → 0.4.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.
Files changed (41) hide show
  1. package/README-zh.md +33 -85
  2. package/README.md +33 -85
  3. package/package.json +44 -42
  4. package/template/index.html +13 -15
  5. package/template/package.json +32 -32
  6. package/template/public/config/site.en.yaml +177 -155
  7. package/template/public/config/site.yaml +179 -166
  8. package/template/public/docs/en/{guide → docs/guide}/configuration.md +195 -149
  9. package/template/public/docs/en/{guide → docs/guide}/installation.md +2 -2
  10. package/template/public/docs/en/docs/guide/quick-start.md +96 -0
  11. package/template/public/docs/en/docs/guide.md +10 -0
  12. package/template/public/docs/en/docs/test/katex-test.md +258 -0
  13. package/template/public/docs/en/docs/test/mdx-test.mdx +136 -0
  14. package/template/public/docs/en/docs/test/test.md +212 -0
  15. package/template/public/docs/en/docs/test.md +9 -0
  16. package/template/public/docs/en/docs.md +16 -0
  17. package/template/public/docs/zh-cn/{guide → docs/guide}/configuration.md +196 -150
  18. package/template/public/docs/zh-cn/{guide → docs/guide}/installation.md +2 -2
  19. package/template/public/docs/zh-cn/{guide → docs/guide}/quick-start.md +13 -25
  20. package/template/public/docs/zh-cn/docs/guide.md +10 -0
  21. package/template/public/docs/zh-cn/docs/test/katex-test.md +260 -0
  22. package/template/public/docs/zh-cn/docs/test/mdx-test.mdx +139 -0
  23. package/template/public/docs/zh-cn/docs/test/test.md +215 -0
  24. package/template/public/docs/zh-cn/docs/test.md +9 -0
  25. package/template/public/docs/zh-cn/docs.md +16 -0
  26. package/template/public/images/yrzx.png +0 -0
  27. package/template/src/components/Alert.tsx +30 -0
  28. package/template/src/components/BadgeList.tsx +38 -0
  29. package/template/src/components/Callout.tsx +20 -0
  30. package/template/src/components/Feature.tsx +15 -0
  31. package/template/src/components/MyTip.tsx +19 -0
  32. package/template/src/components/StepList.tsx +62 -0
  33. package/template/src/main.tsx +14 -16
  34. package/template/tsconfig.app.json +24 -26
  35. package/template/vite-plugin-mdx-components.ts +169 -0
  36. package/template/vite.config.ts +17 -4
  37. package/template/public/docs/en/guide/quick-start.md +0 -108
  38. package/template/public/docs/en/guide.md +0 -10
  39. package/template/public/docs/zh-cn/guide.md +0 -10
  40. /package/template/public/docs/en/{guide → docs/guide}/introduction.md +0 -0
  41. /package/template/public/docs/zh-cn/{guide → docs/guide}/introduction.md +0 -0
package/README-zh.md CHANGED
@@ -1,85 +1,33 @@
1
- 简体中文 | [English](README.md)
2
-
3
- ## create-react-docs-ui
4
-
5
- 秒级搭建 React 文档站,基于 [`react-docs-ui`](https://github.com/shenjianZ/react-docs-ui)。专注写 Markdown,路由、主题、MDX、代码高亮、国际化、侧边栏/目录与命令面板均已预置。
6
-
7
- ### 特性
8
- - 以配置为中心:`public/config/site.yaml`
9
- - 支持 MD/MDX、语法高亮、GFM、简易 Frontmatter 解析
10
- - 亮/暗主题切换与命令面板(Cmd/Ctrl+K)
11
- - 预置多语言目录(如 `en`、`zh-cn`)
12
- - Vite 开箱可用
13
-
14
- ### 环境要求
15
- - Node.js >= 18
16
-
17
- ### 快速开始
18
- - npm:
19
- ```bash
20
- npm create react-docs-ui@latest my-docs
21
- ```
22
- - yarn:
23
- ```bash
24
- yarn create react-docs-ui my-docs
25
- ```
26
- - pnpm:
27
- ```bash
28
- pnpm create react-docs-ui my-docs
29
- ```
30
- 然后:
31
- ```bash
32
- cd my-docs
33
- npm install
34
- npm run dev
35
- ```
36
- 开发地址:http://localhost:5173
37
-
38
- ### 生成项目脚本
39
- - `dev`: 启动 Vite 开发服务器
40
- - `build`: 类型检查并构建
41
- - `preview`: 预览产物
42
-
43
- ### 生成项目结构
44
- - `public/config/site.yaml`、`public/config/site.en.yaml`:按语言的站点配置
45
- - `public/docs/<lang>/**/*.md`:文档 Markdown,路径映射路由
46
- - `src/`:应用入口,一般无需修改
47
-
48
- ### 配置示例(`public/config/site.yaml`)
49
- ```yaml
50
- site:
51
- logo: /logo.svg
52
- title: My Docs
53
- description: Awesome docs
54
- navbar:
55
- showTitle: true
56
- items:
57
- - title: GitHub
58
- link: https://github.com/shenjianZ/react-docs-ui
59
- external: true
60
- sidebar:
61
- collections:
62
- guide:
63
- sections:
64
- - title: 入门
65
- path: guide
66
- children:
67
- - { title: 介绍, path: guide/introduction }
68
- ```
69
-
70
- ### 文档示例(`public/docs/en/guide/introduction.md`)
71
- ```markdown
72
- ---
73
- title: Introduction
74
- ---
75
-
76
- # Introduction
77
-
78
- Welcome to My Docs!
79
- ```
80
-
81
- ### 相关链接
82
- - 底层 UI 库:`react-docs-ui` — https://github.com/shenjianZ/react-docs-ui
83
-
84
- ### 许可证
85
- [MIT](LICENSE)
1
+ 简体中文 | [English](README.md)
2
+
3
+ ## create-react-docs-ui
4
+
5
+ 秒级搭建 React 文档站,基于 [`react-docs-ui`](https://github.com/shenjianZ/react-docs-ui)
6
+
7
+ ### 特性
8
+
9
+ - 配置驱动,通过 `site.yaml` 控制
10
+ - MD/MDX 支持,代码语法高亮
11
+ - 明暗主题切换
12
+ - 命令菜单(Cmd+K)
13
+ - 右键菜单
14
+ - 国际化支持
15
+ - Vite 开箱可用
16
+
17
+ ### 快速开始
18
+
19
+ ```bash
20
+ npm create react-docs-ui@latest my-docs
21
+ cd my-docs
22
+ npm install && npm run dev
23
+ ```
24
+
25
+ ### 项目结构
26
+
27
+ - `public/config/site.yaml` - 网站配置
28
+ - `public/docs/<lang>/**/*.md` - 文档文件
29
+ - `src/` - 应用入口
30
+
31
+ ### 许可证
32
+
33
+ MIT
package/README.md CHANGED
@@ -1,85 +1,33 @@
1
- English | [简体中文](README-zh.md)
2
-
3
- ## create-react-docs-ui
4
-
5
- Scaffold a React documentation site in seconds, powered by [`react-docs-ui`](https://github.com/shenjianZ/react-docs-ui). Focus on writing Markdown; routing, theming, MDX, syntax highlighting, i18n, sidebar/TOC and a command menu are prewired.
6
-
7
- ### Features
8
- - Configuration over code via `public/config/site.yaml`
9
- - MD/MDX rendering, syntax highlight, GFM, simple frontmatter parsing
10
- - Light/dark theme and command palette (Cmd/Ctrl+K)
11
- - Built-in i18n folders (e.g. `en`, `zh-cn`)
12
- - Ready-to-run Vite setup
13
-
14
- ### Requirements
15
- - Node.js >= 18
16
-
17
- ### Quick start
18
- - npm:
19
- ```bash
20
- npm create react-docs-ui@latest my-docs
21
- ```
22
- - yarn:
23
- ```bash
24
- yarn create react-docs-ui my-docs
25
- ```
26
- - pnpm:
27
- ```bash
28
- pnpm create react-docs-ui my-docs
29
- ```
30
- Then:
31
- ```bash
32
- cd my-docs
33
- npm install
34
- npm run dev
35
- ```
36
- Dev server runs at http://localhost:5173
37
-
38
- ### Scripts (generated project)
39
- - `dev`: start Vite dev server
40
- - `build`: type-check and build
41
- - `preview`: preview production build
42
-
43
- ### Project structure (generated)
44
- - `public/config/site.yaml` and `public/config/site.en.yaml`: site config per language
45
- - `public/docs/<lang>/**/*.md`: Markdown docs, matched by route slug
46
- - `src/`: app entry; usually no changes required
47
-
48
- ### Config example (`public/config/site.yaml`)
49
- ```yaml
50
- site:
51
- logo: /logo.svg
52
- title: My Docs
53
- description: Awesome docs
54
- navbar:
55
- showTitle: true
56
- items:
57
- - title: GitHub
58
- link: https://github.com/shenjianZ/react-docs-ui
59
- external: true
60
- sidebar:
61
- collections:
62
- guide:
63
- sections:
64
- - title: Getting Started
65
- path: guide
66
- children:
67
- - { title: Introduction, path: guide/introduction }
68
- ```
69
-
70
- ### Docs example (`public/docs/en/guide/introduction.md`)
71
- ```markdown
72
- ---
73
- title: Introduction
74
- ---
75
-
76
- # Introduction
77
-
78
- Welcome to My Docs!
79
- ```
80
-
81
- ### Links
82
- - Underlying UI library: `react-docs-ui` — https://github.com/shenjianZ/react-docs-ui
83
-
84
- ### License
85
- [MIT](LICENSE)
1
+ English | [简体中文](README-zh.md)
2
+
3
+ ## create-react-docs-ui
4
+
5
+ Scaffold a React documentation site in seconds, powered by [`react-docs-ui`](https://github.com/shenjianZ/react-docs-ui).
6
+
7
+ ### Features
8
+
9
+ - Configuration-driven via `site.yaml`
10
+ - MD/MDX with syntax highlighting
11
+ - Light/dark themes
12
+ - Command menu (Cmd+K)
13
+ - Context menu
14
+ - Internationalization
15
+ - Vite setup
16
+
17
+ ### Quick Start
18
+
19
+ ```bash
20
+ npm create react-docs-ui@latest my-docs
21
+ cd my-docs
22
+ npm install && npm run dev
23
+ ```
24
+
25
+ ### Project Structure
26
+
27
+ - `public/config/site.yaml` - Site configuration
28
+ - `public/docs/<lang>/**/*.md` - Documentation files
29
+ - `src/` - App entry
30
+
31
+ ### License
32
+
33
+ MIT
package/package.json CHANGED
@@ -1,42 +1,44 @@
1
- {
2
- "name": "create-react-docs-ui",
3
- "version": "0.2.0",
4
- "private": false,
5
- "type": "module",
6
- "bin": {
7
- "create-react-docs-ui": "./index.js"
8
- },
9
- "files": [
10
- "index.js",
11
- "template/index.html",
12
- "template/package.json",
13
- "template/public/**/*",
14
- "template/src/main.tsx",
15
- "template/src/react-docs-ui.d.ts",
16
- "template/src/vite-env.d.ts",
17
- "template/tsconfig.app.json",
18
- "template/tsconfig.json",
19
- "template/vite.config.ts",
20
- "README.md",
21
- "README-zh.md"
22
- ],
23
- "description": "Scaffold a React documentation site with one command — built-in routing, theming, MDX, examples, and production-ready build config, powered by react-docs-ui.",
24
- "homepage": "https://github.com/shenjianZ/create-react-docs-ui",
25
- "keywords": [
26
- "react",
27
- "cli",
28
- "scaffolding",
29
- "starter",
30
- "template",
31
- "docs",
32
- "documentation",
33
- "mdx",
34
- "boilerplate",
35
- "create-tool"
36
- ],
37
- "license": "MIT",
38
- "engines": {
39
- "node": ">=18"
40
- },
41
- "packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
42
- }
1
+ {
2
+ "name": "create-react-docs-ui",
3
+ "version": "0.4.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "bin": {
7
+ "create-react-docs-ui": "./index.js"
8
+ },
9
+ "files": [
10
+ "index.js",
11
+ "template/index.html",
12
+ "template/package.json",
13
+ "template/vite-plugin-mdx-components.ts",
14
+ "template/public/**/*",
15
+ "template/src/main.tsx",
16
+ "template/src/react-docs-ui.d.ts",
17
+ "template/src/vite-env.d.ts",
18
+ "template/src/components/**/*",
19
+ "template/tsconfig.app.json",
20
+ "template/tsconfig.json",
21
+ "template/vite.config.ts",
22
+ "README.md",
23
+ "README-zh.md"
24
+ ],
25
+ "description": "Scaffold a React documentation site with one command — built-in routing, theming, MDX, examples, and production-ready build config, powered by react-docs-ui.",
26
+ "homepage": "https://github.com/shenjianZ/create-react-docs-ui",
27
+ "keywords": [
28
+ "react",
29
+ "cli",
30
+ "scaffolding",
31
+ "starter",
32
+ "template",
33
+ "docs",
34
+ "documentation",
35
+ "mdx",
36
+ "boilerplate",
37
+ "create-tool"
38
+ ],
39
+ "license": "MIT",
40
+ "engines": {
41
+ "node": ">=18"
42
+ },
43
+ "packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
44
+ }
@@ -1,15 +1,13 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/images/favicon.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Docs</title>
8
- </head>
9
- <body>
10
- <div id="root"></div>
11
- <script type="module" src="/src/main.tsx"></script>
12
- </body>
13
- </html>
14
-
15
-
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/images/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>React Docs</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -1,32 +1,32 @@
1
- {
2
- "name": "my-react-docs-project",
3
- "version": "0.0.1",
4
- "private": true,
5
- "type": "module",
6
- "scripts": {
7
- "dev": "vite",
8
- "build": "tsc -b && vite build",
9
- "preview": "vite preview"
10
- },
11
- "dependencies": {
12
- "react-docs-ui": "^0.2.0",
13
- "react": "^19.0.0",
14
- "react-dom": "^19.0.0",
15
- "react-router-dom": "^7.8.0"
16
- },
17
- "devDependencies": {
18
- "@types/debug": "^4.1.12",
19
- "@types/hast": "^3.0.4",
20
- "@types/mdast": "^4.0.4",
21
- "@types/ms": "^2.1.0",
22
- "@types/react": "^19.1.9",
23
- "@types/react-dom": "^19.1.7",
24
- "@types/unist": "^3.0.3",
25
- "@vitejs/plugin-react": "^4.7.0",
26
- "typescript": "~5.8.3",
27
- "vite": "^7.1.0"
28
- },
29
- "engines": {
30
- "node": ">=18"
31
- }
32
- }
1
+ {
2
+ "name": "my-react-docs-project",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc -b && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "react": "^19.0.0",
13
+ "react-docs-ui": "^0.4.0",
14
+ "react-dom": "^19.0.0",
15
+ "react-router-dom": "^7.8.0"
16
+ },
17
+ "devDependencies": {
18
+ "@types/debug": "^4.1.12",
19
+ "@types/hast": "^3.0.4",
20
+ "@types/ms": "^2.1.0",
21
+ "@types/react": "^19.1.9",
22
+ "@types/react-dom": "^19.1.7",
23
+ "@types/unist": "^3.0.3",
24
+ "@vitejs/plugin-react": "^4.7.0",
25
+ "typescript": "~5.8.3",
26
+ "unist-util-visit": "^5.0.0",
27
+ "vite": "^7.1.0"
28
+ },
29
+ "engines": {
30
+ "node": ">=18"
31
+ }
32
+ }