Skip to content

Commit 6c25909

Browse files
committed
更新 README 文档,修正配置文件名称并增强快速开始部分的说明
1 parent 3f8caf0 commit 6c25909

File tree

1 file changed

+78
-52
lines changed

1 file changed

+78
-52
lines changed

README.md

Lines changed: 78 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -33,98 +33,127 @@
3333
**ObjectDocs** is a modern, metadata-driven documentation engine architected for the **ObjectStack** ecosystem. Built on top of **Next.js 14 (App Router)** and **Fumadocs**, it redefines how enterprise documentation is maintained.
3434

3535
Unlike traditional static site generators, ObjectDocs adopts a strict **Separation of Concerns** philosophy:
36-
* **Presentation**: Handled by a standardized, logic-free React layer.
37-
* **Configuration**: Defined purely in JSON (`site.json`, `meta.json`).
36+
* **Presentation**: Handled by a standardized, logic-free React layer provided by `@objectdocs/site`.
37+
* **Configuration**: Defined purely in JSON (`docs.site.json`, `meta.json`).
3838
* **Content**: Written in MDX with native support for low-code components.
3939

4040
This architecture allows developers and technical writers to manage complex, multi-product documentation sites without touching a single line of UI code.
4141

4242
## ✨ Key Features
4343

4444
* **🚀 Metadata-Driven Architecture**
45-
Control navigation, sidebars, SEO, and branding entirely via `objectdocs.json` and local `meta.json` files. Zero React knowledge required for content maintainers.
45+
Control navigation, sidebars, SEO, and branding entirely via `docs.site.json` and local `meta.json` files. Zero React knowledge required for content maintainers.
4646

4747
* **🧩 Low-Code Native**
48-
Seamlessly embed live, interactive **Amis** and **Steedos** components directly within your Markdown. Perfect for showcasing live demos of low-code configurations.
48+
Seamlessly embed live, interactive components directly within your Markdown.
4949

50-
* **🗂️ Multi-Product Support**
51-
Native implementation of "Root Toggle" modes, allowing you to host documentation for multiple products (e.g., `ObjectQL` vs. `ObjectUI`) within a single monorepo and domain.
50+
* **🤖 AI Translation**
51+
Built-in CLI command to automatically translate documentation using OpenAI.
5252

5353
* **🎨 Enterprise-Grade UI**
5454
Polished interface built on **Radix UI** and **Tailwind CSS**, featuring automatic dark mode, spotlight effects, and accessible primitives out of the box.
5555

56-
* **⚡ Edge Performance**
57-
Powered by Next.js App Router and ISR (Incremental Static Regeneration), ensuring instant page loads and excellent SEO.
56+
## 🚀 Quick Start
5857

59-
## 🏗️ Architecture
58+
### 1. Create a new project
6059

61-
ObjectDocs enforces a clear directory structure to ensure maintainability at scale:
60+
Initialize your documentation site structure:
6261

63-
```text
64-
.
65-
├── content/ # [Data Layer] Raw Content
66-
│ └── docs/
67-
│ ├── meta.json # Directory structure & sorting control
68-
│ └── index.mdx # Documentation content
69-
├── config/ # [Config Layer]
70-
│ └── site.json # Global settings (Nav, Logo, Branding)
71-
└── app/ # [View Layer] Logic-free Rendering
72-
└── layout.tsx # Consumes config to render UI
62+
```bash
63+
mkdir my-docs
64+
cd my-docs
65+
pnpm init
66+
pnpm add -D @objectdocs/cli
67+
```
68+
69+
### 2. Configure scripts
70+
71+
Add the following scripts to your `package.json`:
7372

73+
```json
74+
{
75+
"scripts": {
76+
"dev": "objectdocs dev",
77+
"build": "objectdocs build",
78+
"start": "objectdocs start"
79+
}
80+
}
7481
```
7582

76-
## 🚀 Quick Start
83+
### 3. Add content
7784

78-
### 1. Clone the repository
85+
Create the basic directory structure:
7986

8087
```bash
81-
git clone [https://github.com/objectstack-ai/objectdocs.git](https://github.com/objectstack-ai/objectdocs.git)
82-
cd objectdocs
83-
88+
mkdir -p content/docs
8489
```
8590

86-
### 2. Install dependencies
91+
Create `content/docs/index.mdx`:
8792

88-
```bash
89-
pnpm install
93+
```mdx
94+
---
95+
title: Welcome
96+
description: My new docs site
97+
---
9098

99+
# Hello World
100+
101+
Welcome to ObjectDocs!
91102
```
92103

93-
### 3. Run development server
104+
Create `content/docs/meta.json`:
105+
106+
```json
107+
{
108+
"pages": ["index"]
109+
}
110+
```
111+
112+
### 4. Start the server
94113

95114
```bash
96115
pnpm dev
97-
98116
```
99117

100-
Open [http://localhost:3000](https://www.google.com/search?q=http://localhost:3000) with your browser to see the result.
118+
Visit http://localhost:7777 to see your site.
119+
120+
## 🏗️ Project Structure
121+
122+
ObjectDocs enforces a clear directory structure to ensure maintainability at scale:
123+
124+
```text
125+
.
126+
├── content/ # [Data Layer] Raw Content
127+
│ ├── docs.site.json # Global settings (Nav, Logo, Branding)
128+
│ └── docs/
129+
│ ├── meta.json # Directory structure & sorting control
130+
│ └── index.mdx # Documentation content
131+
├── package.json
132+
└── ...
133+
```
101134

102135
## ⚙️ Configuration
103136

104137
ObjectDocs is designed to be "Configuration as Code".
105138

106-
### Global Config (`config/site.json`)
139+
### Global Config (`content/docs.site.json`)
107140

108141
Manage global navigation, branding, and feature flags:
109142

110143
```json
111144
{
112145
"branding": {
113146
"name": "ObjectStack",
114-
"logo": "/logo.svg"
147+
"logo": {
148+
"light": "/logo.svg",
149+
"dark": "/logo-dark.svg"
150+
}
115151
},
116-
"navigation": [
152+
"links": [
117153
{ "text": "Guide", "url": "/docs" },
118-
{ "text": "Reference", "url": "/docs/api" },
119-
{ "text": "GitHub", "url": "[https://github.com/objectstack-ai](https://github.com/objectstack-ai)", "external": true }
120-
],
121-
"features": {
122-
"search": true,
123-
"darkMode": true,
124-
"rootToggle": true
125-
}
154+
{ "text": "GitHub", "url": "https://github.com/objectstack-ai", "icon": "github" }
155+
]
126156
}
127-
128157
```
129158

130159
### Sidebar Control (`content/**/meta.json`)
@@ -134,29 +163,26 @@ Control the sidebar order and structure using local metadata files in each direc
134163
```json
135164
{
136165
"title": "Getting Started",
137-
"root": true,
138166
"pages": [
139167
"introduction",
140168
"---Installation---",
141169
"quick-start",
142170
"configuration"
143171
]
144172
}
145-
146173
```
147174

148-
## 🛠️ Tech Stack
175+
## 📦 Packages
176+
177+
This repository is a monorepo managed by pnpm workspaces:
149178

150-
* **Framework**: [Next.js 14 (App Router)](https://nextjs.org/)
151-
* **Core Engine**: [Fumadocs](https://fumadocs.vercel.app/)
152-
* **Styling**: [Tailwind CSS](https://tailwindcss.com/)
153-
* **Icons**: [Lucide React](https://lucide.dev/)
154-
* **Package Manager**: [pnpm](https://pnpm.io/)
179+
- **[@objectdocs/cli](./packages/cli)**: The command-line interface for building and developing sites.
180+
- **[@objectdocs/site](./packages/site)**: The core Next.js application template.
155181

156182
## 🤝 Contributing
157183

158184
Contributions are welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
159185

160186
## 📄 License
161187

162-
This project is licensed under the MIT License - see the [LICENSE](https://www.google.com/search?q=MIT) file for details.
188+
This project is licensed under the MIT License - see the LICENSE file for details.

0 commit comments

Comments
 (0)