create-react-docs-ui 0.1.5 → 0.1.6

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 (2) hide show
  1. package/README-zh.md +85 -0
  2. package/package.json +3 -2
package/README-zh.md ADDED
@@ -0,0 +1,85 @@
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-react-docs-ui",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,7 +17,8 @@
17
17
  "template/tsconfig.app.json",
18
18
  "template/tsconfig.json",
19
19
  "template/vite.config.ts",
20
- "README.md"
20
+ "README.md",
21
+ "README-zh.md"
21
22
  ],
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.",
23
24
  "homepage": "https://github.com/shenjianZ/create-react-docs-ui",