create-react-docs-ui 0.1.1 → 0.1.3

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.
@@ -1,217 +1,109 @@
1
- # Quick Start
2
-
3
- This guide will help you understand the basics of Vue Docs UI and get your documentation website up and running quickly.
4
-
5
- ## Project Overview
6
-
7
- Vue Docs UI follows a simple file-based routing system. Your documentation is organized as:
8
-
9
- - **Configuration**: `public/config/site.yaml` - Site settings and navigation
10
- - **Content**: `public/docs/` - Markdown files for your documentation pages
11
- - **Assets**: `public/images/` - Images and other static assets
12
-
13
- ## Writing Your First Page
14
-
15
- Let's create a simple documentation page:
16
-
17
- ### 1. Create a Markdown File
18
-
19
- Create a new file at `public/docs/my-first-page.md`:
20
-
21
- ```markdown
22
- # My First Page
23
-
24
- Welcome to my documentation! This is written in **Markdown**.
25
-
26
- ## Features
27
-
28
- - Easy to write
29
- - Supports code syntax highlighting
30
- - Responsive design
31
- - Built-in search
32
-
33
- ## Code Example
34
-
35
- ## Lists and More
36
-
37
- 1. Ordered lists work great
38
- 2. With automatic numbering
39
- 3. And proper styling
40
-
41
- - Unordered lists too
42
- - With bullet points
43
- - And consistent spacing
44
- ```
45
-
46
- > **Tip**: Use blockquotes for important notes and tips!
47
-
48
-
49
- ### 2. Add to Navigation
50
-
51
- Update your `public/config/site.yaml` to include the new page:
52
-
53
- ```yaml
54
- sidebar:
55
- sections:
56
- - title: "Getting Started"
57
- path: "/guide"
58
- children:
59
- - title: "My First Page"
60
- path: "/my-first-page"
61
- ```
62
-
63
- ### 3. View Your Page
64
-
65
- Start the development server and navigate to your new page:
66
-
67
- ```bash
68
- npm run dev
69
- ```
70
-
71
- Visit `http://localhost:5173/my-first-page` to see your page!
72
-
73
- ## Understanding Configuration
74
-
75
- The `site.yaml` file controls your entire site structure:
76
-
77
- ### Site Settings
78
- ```yaml
79
- site:
80
- title: "Your Site Title"
81
- description: "Site description for SEO"
82
- logo: "📚" # Emoji, image URL, or path
83
- author: "Your Name"
84
- ```
85
-
86
- ### Navigation Bar
87
- ```yaml
88
- navbar:
89
- items:
90
- - title: "Home"
91
- link: "/"
92
- - title: "GitHub"
93
- link: "https://github.com/username/repo"
94
- external: true
95
- ```
96
-
97
- ### Sidebar Navigation
98
- ```yaml
99
- sidebar:
100
- sections:
101
- - title: "Section Name"
102
- path: "/section"
103
- children:
104
- - title: "Page Title"
105
- path: "/page-path"
106
- ```
107
-
108
- ## Markdown Features
109
-
110
- Vue Docs UI supports enhanced Markdown with:
111
-
112
- ### Code Highlighting
113
- ```javascript
114
- // JavaScript code is highlighted
115
- function greet(name) {
116
- return `Hello, ${name}!`
117
- }
118
- ```
119
-
120
- ### Tables
121
- | Feature | Status | Description |
122
- |---------|--------|-------------|
123
- | Responsive | ✅ | Works on all devices |
124
- | Themes | ✅ | Light and dark mode |
125
- | Search | ✅ | Built-in search |
126
-
127
- ### Math (Optional)
128
- If you need math equations, you can add support for LaTeX:
129
-
130
- Inline math: $E = mc^2$
131
-
132
- Block math:
133
- $$
134
- \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
135
- $$
136
-
137
- ## Customizing Appearance
138
-
139
- ### Theme Colors
140
- Customize your site's colors in `site.yaml`:
141
-
142
- ```yaml
143
- theme:
144
- colors:
145
- primary: "#3b82f6" # Main brand color
146
- secondary: "#64748b" # Secondary text
147
- accent: "#06b6d4" # Accent color
148
- ```
149
-
150
- ### Fonts
151
- ```yaml
152
- theme:
153
- fonts:
154
- primary: "Inter, -apple-system, BlinkMacSystemFont, sans-serif"
155
- mono: "JetBrains Mono, Consolas, monospace"
156
- ```
157
-
158
- ## Adding Images
159
-
160
- Place images in `public/images/` and reference them in your Markdown:
161
-
162
- ```markdown
163
- ![Logo](/images/logo.png)
164
- ```
165
-
166
- Or with custom sizing:
167
- ```markdown
168
- <img src="/images/screenshot.png" alt="Screenshot" width="600">
169
- ```
170
-
171
- ## Best Practices
172
-
173
- ### 1. Organize Your Content
174
- ```
175
- public/docs/
176
- ├── guide/
177
- │ ├── introduction.md
178
- │ ├── installation.md
179
- │ └── quick-start.md
180
- ├── api/
181
- │ ├── components.md
182
- │ └── utilities.md
183
- └── examples/
184
- ├── basic.md
185
- └── advanced.md
186
- ```
187
-
188
- ### 2. Use Descriptive Titles
189
- - Good: "Setting up Authentication"
190
- - Bad: "Auth Setup"
191
-
192
- ### 3. Add Table of Contents
193
- Enable TOC in your `site.yaml`:
194
-
195
- ```yaml
196
- toc:
197
- enabled: true
198
- maxLevel: 3
199
- title: "On This Page"
200
- ```
201
-
202
- ### 4. Link Between Pages
203
- Use relative links to connect your content:
204
-
205
- ```markdown
206
- Check out our [Installation Guide](/guide/installation) for setup instructions.
207
- ```
208
-
209
- ## What's Next?
210
-
211
- Now that you understand the basics:
212
-
213
- 1. **[Configuration](/guide/configuration)** - Learn about all available options
214
- 2. **[Advanced Features](/advanced/customization)** - Customize your site further
215
- 3. **[Deployment](/advanced/deployment)** - Deploy your site to production
216
-
217
- Happy documenting! 🚀
1
+ # Quick Start
2
+
3
+ This guide will walk you through creating, configuring, and running your own React documentation website from scratch in 5 minutes.
4
+
5
+ ## 1. Create the Project
6
+
7
+ Using the official scaffolding tool is the most efficient way. Open your terminal and run the following command:
8
+
9
+ ```bash
10
+ # This creates a project named "my-awesome-docs"
11
+ npx create-react-docs-ui@latest my-awesome-docs
12
+ ```
13
+
14
+ Next, enter the project directory and install the dependencies:
15
+
16
+ ```bash
17
+ cd my-awesome-docs
18
+ npm install
19
+ ```
20
+
21
+ ## 2. Organize Your Documents
22
+
23
+ All your documentation content is stored as Markdown files in the `public/docs/` directory.
24
+
25
+ - Open the `public/docs/en/` directory.
26
+ - You can modify the existing `index.md` and files under the `guide` directory, or create new `.md` files.
27
+
28
+ For example, let's create a new page. Create a new file named `about.md` in `public/docs/en/`:
29
+
30
+ ```markdown
31
+ ---
32
+ title: About Us
33
+ description: This is a page about our team.
34
+ ---
35
+
36
+ # About Us
37
+
38
+ We love open source and creation!
39
+ ```
40
+
41
+ **Note**: You can use `frontmatter` at the top of your Markdown files to define the page `title` and `description`.
42
+
43
+ ## 3. Configure the Website
44
+
45
+ Now, let's display the newly created page by modifying the configuration file.
46
+
47
+ Open the core configuration file `public/config/site.yaml`.
48
+
49
+ ### a. Modify Site Information
50
+
51
+ Update the `site` section to give your website a new title and logo.
52
+
53
+ ```yaml
54
+ site:
55
+ title: "My Awesome Docs"
56
+ description: "A website built with React Docs UI"
57
+ logo: "🚀" # You can use an emoji or an image path
58
+ ```
59
+
60
+ ### b. Add to the Navbar
61
+
62
+ In the `navbar.items` array, add a link for the "About" page. Remember to update the links for the English version.
63
+
64
+ ```yaml
65
+ navbar:
66
+ items:
67
+ - title: "Home"
68
+ link: "/en/"
69
+ - title: "Guide"
70
+ link: "/en/guide/introduction"
71
+ - title: "About" # New
72
+ link: "/en/about" # New
73
+ ```
74
+
75
+ ### c. Add to the Sidebar
76
+
77
+ To make the "About" page visible in the sidebar, we'll add a new entry in `sidebar.collections.guide.sections`. Make sure to use English paths.
78
+
79
+ ```yaml
80
+ sidebar:
81
+ collections:
82
+ guide:
83
+ sections:
84
+ - title: "Getting Started"
85
+ path: "/en/guide"
86
+ children:
87
+ - title: "Introduction"
88
+ path: "/en/guide/introduction"
89
+ - title: "Installation"
90
+ path: "/en/guide/installation"
91
+ - title: "Quick Start"
92
+ path: "/en/guide/quick-start"
93
+ # You can create a new section for the "About" page
94
+ - title: "About Us"
95
+ path: "/en/about"
96
+ children:
97
+ - title: "About"
98
+ path: "/en/about"
99
+ ```
100
+
101
+ ## 4. Launch the Website
102
+
103
+ Save all your changes and run the following command in your terminal:
104
+
105
+ ```bash
106
+ npm run dev
107
+ ```
108
+
109
+ Your website should now be running at `http://localhost:5173`. Visit it, and you will see the updated title, logo, and the new "About" link in the navbar and sidebar. Congratulations, you have successfully mastered the basic workflow of React Docs UI!
@@ -1,31 +1,10 @@
1
- # Getting Started
2
-
3
- ## Getting Started with Vue Docs UI
4
-
5
- Welcome to Vue Docs UI! This is a modern documentation website building tool based on Vue 3.
6
-
7
- ## Quick Overview
8
-
9
- Vue Docs UI enables you to:
10
- - 🚀 **Quick Start** - Create beautiful documentation websites with just a few lines of code
11
- - 📱 **Responsive Design** - Perfect adaptation to all devices
12
- - 🎨 **Highly Customizable** - Flexible theme and style configuration
13
- - 📝 **Markdown Support** - Use familiar Markdown syntax
14
-
15
- ## Learning Path
16
-
17
- ### [📖 Introduction](/guide/introduction)
18
- Learn about Vue Docs UI's core concepts and features
19
-
20
- ### [⚡ Installation](/guide/installation)
21
- Learn how to install and set up Vue Docs UI
22
-
23
- ### [🏃‍♂️ Quick Start](/guide/quick-start)
24
- Get hands-on experience through practical examples
25
-
26
- ### [⚙️ Configuration](/guide/configuration)
27
- Deep dive into configuration options and customization methods
28
-
29
- ## Ready to Start?
30
-
31
- Choose any of the topics above to begin your learning journey, or jump directly to [Quick Start](/guide/quick-start) to experience it immediately!
1
+ # Guide
2
+
3
+ This guide will help you fully understand and master all the features of React Docs UI. Whether you are a beginner or looking for in-depth customization, you will find the information you need here.
4
+
5
+ ## Table of Contents
6
+
7
+ - **[Introduction](/guide/introduction)**: Learn about the core philosophy and main advantages of React Docs UI.
8
+ - **[Installation](/guide/installation)**: Learn how to install via the scaffolding tool or manually.
9
+ - **[Quick Start](/guide/quick-start)**: Create and run your first documentation website in 5 minutes.
10
+ - **[Configuration (`site.yaml`)](/guide/configuration)**: Dive deep into each configuration option to take full control of your site.
@@ -1,58 +1,34 @@
1
- # Welcome to Vue Docs UI
2
-
3
- Vue Docs UI is a modern documentation website builder based on Vue 3, providing an out-of-the-box documentation solution.
4
-
5
- ## 🌟 Key Features
6
-
7
- - **🚀 Ready to Use** - Launch your documentation website with just 3 lines of code
8
- - **🎨 Modern Design** - Beautiful interface design with light/dark theme support
9
- - **📱 Mobile Responsive** - Perfect responsive design
10
- - **🌐 Internationalization** - Built-in multi-language support
11
- - **🤖 AI Assistant** - Integrated AI chat assistant with multiple model support
12
- - **⚡ High Performance** - Built with Vite for fast hot reload
13
- - **🔍 Full-text Search** - Smart search functionality
14
- - **📝 Enhanced Markdown** - Rich Markdown extensions
15
-
16
- ## 🏗️ Architecture Features
17
-
18
- - **Component-based Design** - Modular components, easy to extend
19
- - **TypeScript Support** - Complete type support
20
- - **Customizable Themes** - Flexible theme configuration
21
- - **Plugin System** - Extensible plugin architecture
22
-
23
- ## 📦 Quick Start
24
-
25
- ```bash
26
- # Create new project
27
- npm create vue-docs-ui@latest my-docs
28
-
29
- # Navigate to project directory
30
- cd my-docs
31
-
32
- # Install dependencies
33
- npm install
34
-
35
- # Start development server
36
- npm run dev
37
- ```
38
-
39
- ## 📖 Usage
40
-
41
- ```javascript
42
- import { createDocsApp } from 'vue-docs-ui'
43
- import 'vue-docs-ui/dist/vue-docs-ui.css'
44
-
45
- createDocsApp({
46
- configPath: '/config/site.yaml',
47
- el: '#app'
48
- })
49
- ```
50
-
51
- It's that simple! No complex configuration needed, get a fully functional documentation website immediately.
52
-
53
- ## 🔗 Related Links
54
-
55
- - [GitHub Repository](https://github.com/shenjianZ/vue-docs-ui)
56
- - [Online Demo](https://vue-docs-ui.example.com)
57
- - [User Guide](/guide/introduction)
58
- - [API Documentation](/advanced/api)
1
+ # React Docs UI
2
+
3
+ A **configuration-driven** modern documentation website builder based on React.
4
+
5
+ React Docs UI aims to make creating beautiful, powerful documentation websites simpler than ever. You just need to focus on writing Markdown documents, and everything else—from routing and navigation to theme switching and the command menu—is driven by a simple YAML configuration.
6
+
7
+ ## Core Features
8
+
9
+ - **Configuration-Driven**: Define your entire website via `site.yaml` without coding.
10
+ - **Out-of-the-Box**: Quickly start your project with all necessary features built-in.
11
+ - **Modern Design**: Elegant responsive layout with automatic light/dark theme switching.
12
+ - **Command Menu**: Built-in `Cmd+K` shortcut menu for quick page access.
13
+ - **Markdown Support**: Full support for GFM and Frontmatter.
14
+ - **Internationalization**: Easily implement multi-language support through configuration files.
15
+
16
+ ## Quick Start
17
+
18
+ Get your own documentation website with just one command:
19
+
20
+ ```bash
21
+ # Create the project
22
+ npx create-react-docs-ui@latest my-docs
23
+
24
+ # Enter the project directory
25
+ cd my-docs
26
+
27
+ # Install dependencies and start
28
+ npm install && npm run dev
29
+ ```
30
+
31
+ ## Links
32
+
33
+ - **[Guide](/guide/introduction)**: Start learning about all the features of React Docs UI.
34
+ - **[GitHub](https://github.com/shenjianZ/react-docs-ui)**: View the source code, submit issues, or contribute.
@@ -1,6 +1,6 @@
1
1
  # 配置文件 (`site.yaml`) 详解
2
2
 
3
- `vue-docs-ui` 的核心是其**配置驱动**的理念。你几乎可以通过 `public/config/site.yaml` 这一个文件来定义整个网站的外观和行为。本文档将详细解释每个配置项。
3
+ `react-docs-ui` 的核心是其**配置驱动**的理念。你几乎可以通过 `public/config/site.yaml` 这一个文件来定义整个网站的外观和行为。本文档将详细解释每个配置项。
4
4
 
5
5
  ## 顶级配置项概览
6
6
 
@@ -12,9 +12,6 @@
12
12
  | `theme` | 配置网站的主题,如颜色、浅色/深色模式。 |
13
13
  | `footer` | 配置网站底部的页脚信息。 |
14
14
  | `toc` | 配置文章页面右侧的目录(Table of Contents)。 |
15
- | `search` | 配置内置的全文搜索功能。 |
16
- | `pwa` | 配置渐进式Web应用(PWA)相关设置。 |
17
- | `ai` | 配置 AI 助手功能。 |
18
15
 
19
16
  ---
20
17
 
@@ -24,15 +21,15 @@
24
21
 
25
22
  | 字段 | 说明 | 示例 |
26
23
  | :--- | :--- | :--- |
27
- | `title` | 网站标题,显示在浏览器标签页上。 | `"Vue Docs UI"` |
28
- | `description` | 网站描述,用于搜索引擎优化 (SEO)。 | `"一个 Vue 3 文档网站构建工具"` |
29
- | `logo` | 网站 Logo,显示在导航栏左上角。 | `"📚"` 或 `"/images/logo.png"` |
30
- | `author` | 网站作者。 | `"Vue Docs UI Team"` |
24
+ | `title` | 网站标题,显示在浏览器标签页上。 | `"React Docs UI"` |
25
+ | `description` | 网站描述,用于搜索引擎优化 (SEO)。 | `"一个 React 文档网站构建工具"` |
26
+ | `logo` | 网站 Logo,显示在导航栏左上角。 | `"📚"` 或 `"/images/logo.png"` 或一个包含 `light` 和 `dark` 模式图片路径的对象 |
27
+ | `author` | 网站作者。 | `"React Docs UI Team"` |
31
28
 
32
29
  **Logo 格式说明:**
33
30
  1. **Emoji**: 直接使用一个表情符号,如 `"🚀"`。
34
31
  2. **本地图片**: 指向 `public` 目录下的图片路径,如 `"/images/logo.png"`。
35
- 3. **外部图片 URL**: 一个完整的图片链接。
32
+ 3. **亮/暗模式图片**: 一个对象,包含 `light` 和 `dark` 两个键,分别指向不同主题下的图片路径。
36
33
 
37
34
  ---
38
35
 
@@ -43,6 +40,7 @@
43
40
  | 字段 | 说明 |
44
41
  | :--- | :--- |
45
42
  | `items` | 导航项数组,定义了导航栏中显示的所有链接。 |
43
+ | `actions` | (可选) 导航栏右侧的操作按钮,如 GitHub 链接。 |
46
44
 
47
45
  ### `navbar.items`
48
46
 
@@ -56,13 +54,15 @@
56
54
 
57
55
  ## `sidebar`
58
56
 
59
- 侧边栏导航配置,是文档结构的核心。
57
+ 侧边栏导航配置,是文档结构的核心。它使用 `collections` 来组织不同部分的内容。
60
58
 
61
59
  | 字段 | 说明 |
62
60
  | :--- | :--- |
63
- | `sections` | 侧边栏区域数组,每个区域代表一个可折叠的菜单组。 |
61
+ | `collections` | 一个对象,键是集合的名称(通常对应一级路由,如 `guide`),值是该集合的侧边栏配置。 |
64
62
 
65
- ### `sidebar.sections`
63
+ ### `sidebar.collections.<name>.sections`
64
+
65
+ 每个集合包含一个 `sections` 数组,每个 `section` 代表一个可折叠的菜单组。
66
66
 
67
67
  | 字段 | 说明 | 示例 |
68
68
  | :--- | :--- | :--- |
@@ -70,7 +70,7 @@
70
70
  | `path` | 区域的基础路径。当用户访问的 URL 以此路径开头时,该区域会自动展开并高亮。 | `"/guide"` |
71
71
  | `children` | 该区域下的子链接数组。 | |
72
72
 
73
- ### `sidebar.sections.children`
73
+ ### `sidebar.collections.<name>.sections.children`
74
74
 
75
75
  | 字段 | 说明 | 示例 |
76
76
  | :--- | :--- | :--- |
@@ -85,9 +85,8 @@
85
85
 
86
86
  | 字段 | 说明 | 可选值 | 默认值 |
87
87
  | :--- | :--- | :--- | :--- |
88
- | `defaultMode` | 网站的默认主题模式。 | `'light'`, `'dark'`, `'auto'` | `'auto'` |
88
+ | `defaultMode` | 网站的默认主题模式。 | `'light'`, `'dark'`, `'system'` | `'system'` |
89
89
  | `allowToggle` | 是否允许用户切换主题。 | `true`, `false` | `true` |
90
- | `primaryColor`| 网站的主题色。 | CSS 颜色值 | `"#3b82f6"` |
91
90
 
92
91
  ---
93
92
 
@@ -110,14 +109,6 @@
110
109
  | `branch` | 文档所在的 Git 分支。 | `"main"` |
111
110
  | `dir` | 文档文件在仓库中的根目录。 | `"docs/src"` |
112
111
 
113
- ### `footer.social`
114
-
115
- | 字段 | 说明 | 示例 |
116
- | :--- | :--- | :--- |
117
- | `name` | 社交媒体名称,用于 `aria-label`。 | `"GitHub"` |
118
- | `url` | 链接地址。 | `"https://github.com/user"` |
119
- | `icon` | 图标标识符,支持 `github`, `twitter`, `discord` 等。 | `"github"` |
120
-
121
112
  ---
122
113
 
123
114
  ## `toc` (Table of Contents)
@@ -129,41 +120,3 @@
129
120
  | `enabled` | 是否启用页面目录功能。 | `true` |
130
121
  | `maxLevel` | 在目录中显示的最大标题级别(h1-h6)。 | `3` |
131
122
  | `title` | 目录组件的标题。 | `"本页内容"` |
132
-
133
- ---
134
-
135
- ## `search`
136
-
137
- 内置搜索功能配置。
138
-
139
- | 字段 | 说明 | 示例 |
140
- | :--- | :--- | :--- |
141
- | `enabled` | 是否启用搜索功能。 | `true` |
142
- | `placeholder` | 搜索框的占位文本。 | `"搜索文档..."` |
143
-
144
- ---
145
-
146
- ## `pwa`
147
-
148
- 渐进式Web应用配置。
149
-
150
- | 字段 | 说明 | 示例 |
151
- | :--- | :--- | :--- |
152
- | `enabled` | 是否启用 PWA 功能。 | `true` |
153
- | `name` | PWA 的完整名称。 | `"Vue Docs UI"` |
154
- | `shortName` | PWA 的短名称。 | `"VueDocs"` |
155
-
156
- ---
157
-
158
- ## `ai`
159
-
160
- AI 助手配置。
161
-
162
- | 字段 | 说明 | 示例 |
163
- | :--- | :--- | :--- |
164
- | `enabled` | 是否启用 AI 助手功能。 | `true` |
165
- | `buttonTitle` | 浮动按钮的标题。 | `"AI 助手"` |
166
- | `modalTitle` | 对话框的标题。 | `"与 AI 对话"` |
167
- | `placeholder` | 输入框的占位文本。 | `"向我提问..."` |
168
-
169
- **注意**: AI 功能的 `provider` 和 `apiKey` 等敏感信息在 `public/config/ai.json` 中单独配置,以避免意外泄露。