From 21ec5c3d61958194737e15cd9736a5a06cc632d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 05:37:29 +0000 Subject: [PATCH 1/3] Initial plan From 62e107d41ce579bac5c8825bfbfcdce57d1d5ec8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 05:44:00 +0000 Subject: [PATCH 2/3] Refactor documentation to match current implementation Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com> --- README.md | 63 ++++++++-------- .../docs/getting-started/architecture.cn.mdx | 72 +++++++++++++++---- content/docs/getting-started/architecture.mdx | 72 +++++++++++++++---- .../docs/getting-started/configuration.cn.mdx | 23 +++++- .../docs/getting-started/configuration.mdx | 21 +++++- content/docs/getting-started/index.cn.mdx | 55 ++++++++------ content/docs/getting-started/index.mdx | 55 ++++++++------ content/docs/index.cn.mdx | 11 ++- content/docs/index.mdx | 11 ++- 9 files changed, 273 insertions(+), 110 deletions(-) diff --git a/README.md b/README.md index 2aa7aba..acc525c 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,9 @@ npx @objectdocs/cli init ``` This will: -- Create `content/package.json` with necessary scripts -- Copy the site engine to `content/.objectdocs` -- Install dependencies in `content/.objectdocs/node_modules` +- Copy the site engine from `@objectdocs/site` to `content/.objectdocs` +- Create `content/package.json` with scripts (`dev`, `build`, `start`) +- Install dependencies in `content/.objectdocs` - Automatically add `content/.objectdocs` and `content/node_modules` to `.gitignore` - Keep your project root clean and unpolluted @@ -99,38 +99,17 @@ cd content && npm run dev Visit http://localhost:7777 to see your site. -### Option 2: New Standalone Project +### Option 2: Use npm init -For a new dedicated documentation project: +For a quick start with automatic initialization: ```bash mkdir my-docs cd my-docs -npm init -y -npm install -D @objectdocs/cli +npm init @objectdocs ``` -Add scripts to your root `package.json`: - -```json -{ - "scripts": { - "dev": "cd content && npm run dev", - "build": "cd content && npm run build", - "start": "cd content && npm run start" - } -} -``` - -Initialize ObjectDocs: - -```bash -npm run init -# or -npx objectdocs init -``` - -Then follow the same steps as Option 1 to add content. +This runs the init command automatically. Then follow the same steps as Option 1 to add content. ## 🏗️ Project Structure @@ -139,19 +118,24 @@ ObjectDocs enforces a clear directory structure to ensure maintainability at sca ```text . ├── content/ # [Data Layer] All documentation files -│ ├── package.json # npm scripts (dev, build, start) -│ ├── .objectdocs/ # Site engine (auto-generated, gitignored) -│ ├── docs.site.json # Global settings (Nav, Logo, Branding) +│ ├── package.json # Scripts: dev, build, start (created by init) +│ ├── .objectdocs/ # Site engine (copied from @objectdocs/site, gitignored) +│ │ ├── node_modules/ # Dependencies (installed during init) +│ │ ├── .next/ # Next.js build cache (development) +│ │ └── out/ # Static build output (production) +│ ├── docs.site.json # Global config (Nav, Logo, Branding, i18n) │ └── docs/ -│ ├── meta.json # Directory structure & sorting control +│ ├── meta.json # Directory structure & page order │ └── index.mdx # Documentation content +├── out/ # Final build output (copied from content/.objectdocs/out) ├── package.json # (Optional) Root project package.json └── ... ``` **Key Points:** - All documentation-related files are in `content/` -- `content/.objectdocs/` is auto-generated and gitignored +- `content/.objectdocs/` contains the complete Next.js site engine (auto-generated, gitignored) +- Build output: `content/.objectdocs/out` → copied to root `out/` directory - Your project root remains clean - Perfect for adding docs to any existing project @@ -161,7 +145,7 @@ ObjectDocs is designed to be "Configuration as Code". ### Global Config (`content/docs.site.json`) -Manage global navigation, branding, and feature flags: +Manage global navigation, branding, i18n, and feature flags: ```json { @@ -175,10 +159,19 @@ Manage global navigation, branding, and feature flags: "links": [ { "text": "Guide", "url": "/docs" }, { "text": "GitHub", "url": "https://github.com/objectstack-ai", "icon": "github" } - ] + ], + "i18n": { + "defaultLanguage": "en", + "languages": ["en", "zh-CN", "ja", "es", "fr", "de", "ko", "ru", "pt", "ar", "hi", "it", "tr", "vi"] + } } ``` +**Supported Features:** +- 14 languages for internationalization +- Automatic config watching and hot reload during development +- Config is copied to `content/.objectdocs` before each build/dev command + ### Sidebar Control (`content/**/meta.json`) Control the sidebar order and structure using local metadata files in each directory: diff --git a/content/docs/getting-started/architecture.cn.mdx b/content/docs/getting-started/architecture.cn.mdx index 84b84b0..5f800b0 100644 --- a/content/docs/getting-started/architecture.cn.mdx +++ b/content/docs/getting-started/architecture.cn.mdx @@ -30,29 +30,77 @@ ObjectDocs 建立在严格的 **关注点分离 (Separation of Concerns)** 理 ## 目录结构 -一个标准的 ObjectDocs 项目结构如下: +初始化后的标准 ObjectDocs 项目结构: ```text . -├── content/ # [数据层] 原始内容 -│ ├── docs.site.json # 全局设置 (导航, Logo, 品牌) +├── content/ # [数据层] 所有文档文件 +│ ├── package.json # 脚本: dev, build, start (由 init 创建) +│ ├── .objectdocs/ # 站点引擎 (从 @objectdocs/site 复制, gitignored) +│ │ ├── node_modules/ # 依赖 (初始化时安装) +│ │ ├── .next/ # Next.js 构建缓存 (开发) +│ │ └── out/ # 静态构建输出 (生产) +│ ├── docs.site.json # 全局配置 (导航, Logo, 品牌, i18n) +│ ├── public/ # 静态资源 (在构建/开发时复制到站点) │ └── docs/ -│ ├── meta.json # 目录结构 & 排序控制 +│ ├── meta.json # 目录结构 & 页面顺序 │ └── index.mdx # 文档内容 -├── package.json -└── public/ # 静态资源 (图片等) +├── out/ # 最终构建输出 (从 content/.objectdocs/out 复制) +├── .gitignore # 自动更新以排除 content/.objectdocs +├── package.json # (可选) 根目录 package.json +└── ... ``` +**核心组件:** +- **`content/.objectdocs/`**: 包含来自 `@objectdocs/site` 包的完整 Next.js 站点引擎 +- **`content/package.json`**: 由 init 命令创建,包含 dev/build/start 脚本 +- **构建流程**: `content/.objectdocs/out` → `out/` (根目录) +- **环境**: 命令在 `content/.objectdocs` 内运行,`DOCS_DIR` 环境变量指向文档目录 + ## 数据流向 -1. **构建时**: `@objectdocs/site` 读取 `content/` 下的所有 MDX 和 JSON 文件。 -2. **解析**: Fumadocs 引擎解析元数据,构建导航树。 -3. **渲染**: Next.js (App Router) 将内容渲染为 React Server Components。 -4. **交互**: 客户端组件(如 ``, ``)在浏览器中激活。 +### 初始化流程 +1. **初始化命令**: `npx @objectdocs/cli init` +2. **包复制**: 整个 `@objectdocs/site` 包 → `content/.objectdocs` +3. **脚本创建**: 创建 `content/package.json` 并添加 dev/build/start 脚本 +4. **依赖安装**: 在 `content/.objectdocs` 中运行 `npm install` +5. **Gitignore 更新**: 添加排除生成文件的规则 + +### 开发流程 +1. **启动**: 运行 `cd content && npm run dev` +2. **配置同步**: 复制 `docs.site.json` 和 `public/` 到 `content/.objectdocs` +3. **环境**: 设置 `DOCS_DIR` 环境变量指向 `content/docs` +4. **监听**: 监控 `docs.site.json` 的变化并自动重启 +5. **服务器**: Next.js 开发服务器在端口 7777 上运行(默认) + +### 构建流程 +1. **构建时**: 运行 `cd content && npm run build` +2. **配置同步**: 复制 `docs.site.json` 和 `public/` 到 `content/.objectdocs` +3. **环境**: 设置 `DOCS_DIR` 环境变量 +4. **MDX 解析**: Fumadocs 从 `DOCS_DIR` 读取所有 `.mdx` 文件 +5. **元数据**: 解析 `meta.json` 文件构建导航树 +6. **渲染**: Next.js App Router 将内容渲染为 React Server Components +7. **输出**: + - 静态模式: `content/.objectdocs/out` → `out/` (根目录) + - 动态模式: `content/.objectdocs/.next` → `.next/` (根目录) + +### 运行流程 (静态) +1. **服务**: 从 `out/` 目录提供生产构建 +2. **资源**: 静态 HTML、CSS、JS 和图片 +3. **CDN**: 可以部署到 Vercel、Netlify 或任何静态托管 + +### 运行流程 (动态) +1. **启动**: 运行 `cd content && npm run start` +2. **服务器**: 具有 ISR/SSR 功能的 Next.js 生产服务器 +3. **交互**: 客户端组件(如 ``, ``)在浏览器中激活 ### 为什么这样设计? 这种架构使得我们能够: -* **多产品支持**: 通过切换不同的 `content` 目录,可以在同一套代码库中支持多个产品的文档。 -* **低代码集成**: 因为内容与 UI 分离,我们可以更容易地注入动态的低代码组件演示。 +* **清晰分离**: 将文档内容与站点引擎完全分离 +* **项目无关**: 可以在任何现有项目中添加文档而不污染根目录 +* **版本控制**: 整个站点引擎都被 gitignore,只跟踪内容 +* **多产品支持**: 通过切换不同的 `content` 目录,可以支持多个产品的文档 +* **低代码集成**: 因为内容与 UI 分离,我们可以更容易地注入动态的低代码组件演示 +* **轻松更新**: 通过重新运行 init 或更新 CLI 版本来更新站点引擎 diff --git a/content/docs/getting-started/architecture.mdx b/content/docs/getting-started/architecture.mdx index 33cc399..e63a0ef 100644 --- a/content/docs/getting-started/architecture.mdx +++ b/content/docs/getting-started/architecture.mdx @@ -30,29 +30,77 @@ Each documentation directory is self-contained. If you want to add a new section ## Directory Structure -A standard ObjectDocs project structure looks like this: +A standard ObjectDocs project structure after initialization: ```text . -├── content/ # [Data Layer] Raw Content -│ ├── docs.site.json # Global settings (Nav, Logo, Branding) +├── content/ # [Data Layer] All documentation files +│ ├── package.json # Scripts: dev, build, start (created by init) +│ ├── .objectdocs/ # Site engine (copied from @objectdocs/site, gitignored) +│ │ ├── node_modules/ # Dependencies (installed during init) +│ │ ├── .next/ # Next.js build cache (development) +│ │ └── out/ # Static build output (production) +│ ├── docs.site.json # Global config (Nav, Logo, Branding, i18n) +│ ├── public/ # Static assets (copied to site during build/dev) │ └── docs/ -│ ├── meta.json # Directory structure & sorting control +│ ├── meta.json # Directory structure & page order │ └── index.mdx # Documentation content -├── package.json -└── public/ # Static assets (images, etc.) +├── out/ # Final build output (copied from content/.objectdocs/out) +├── .gitignore # Auto-updated to exclude content/.objectdocs +├── package.json # (Optional) Root project package.json +└── ... ``` +**Key Components:** +- **`content/.objectdocs/`**: Contains the complete Next.js site engine from `@objectdocs/site` package +- **`content/package.json`**: Created by init command with dev/build/start scripts +- **Build Flow**: `content/.objectdocs/out` → `out/` (root directory) +- **Environment**: Commands run inside `content/.objectdocs` with `DOCS_DIR` env variable pointing to docs + ## Data Flow -1. **Build Time**: `@objectdocs/site` reads all MDX and JSON files under `content/`. -2. **Parsing**: The Fumadocs engine parses metadata and builds the navigation tree. -3. **Rendering**: Next.js (App Router) renders content as React Server Components. -4. **Interaction**: Client components (like ``, ``) activate in the browser. +### Initialization Flow +1. **Init Command**: `npx @objectdocs/cli init` +2. **Package Copy**: Entire `@objectdocs/site` package → `content/.objectdocs` +3. **Script Creation**: `content/package.json` with dev/build/start scripts +4. **Dependency Install**: `npm install` in `content/.objectdocs` +5. **Gitignore Update**: Add exclusions for generated files + +### Development Flow +1. **Start**: Run `cd content && npm run dev` +2. **Config Sync**: Copy `docs.site.json` and `public/` to `content/.objectdocs` +3. **Environment**: Set `DOCS_DIR` env variable to point to `content/docs` +4. **Watch**: Monitor `docs.site.json` for changes and auto-restart +5. **Server**: Next.js dev server runs on port 7777 (default) + +### Build Flow +1. **Build Time**: Run `cd content && npm run build` +2. **Config Sync**: Copy `docs.site.json` and `public/` to `content/.objectdocs` +3. **Environment**: Set `DOCS_DIR` env variable +4. **MDX Parsing**: Fumadocs reads all `.mdx` files from `DOCS_DIR` +5. **Metadata**: Parse `meta.json` files to build navigation tree +6. **Rendering**: Next.js App Router renders as React Server Components +7. **Output**: + - Static mode: `content/.objectdocs/out` → `out/` (root) + - Dynamic mode: `content/.objectdocs/.next` → `.next/` (root) + +### Runtime Flow (Static) +1. **Serve**: Production build served from `out/` directory +2. **Assets**: Static HTML, CSS, JS, and images +3. **CDN**: Can be deployed to Vercel, Netlify, or any static host + +### Runtime Flow (Dynamic) +1. **Start**: Run `cd content && npm run start` +2. **Server**: Next.js production server with ISR/SSR capabilities +3. **Interaction**: Client components (like ``, ``) hydrate in browser ### Why Design It This Way? This architecture allows us to: -* **Multi-Product Support**: By switching different `content` directories, multiple product documentations can be supported within the same codebase. -* **Low-Code Integration**: Since content is separated from UI, we can more easily inject dynamic low-code component demos. +* **Clean Separation**: Keep the documentation content completely separate from the site engine +* **Project Agnostic**: Add docs to any existing project without polluting the root directory +* **Version Control**: The entire site engine is gitignored, only content is tracked +* **Multi-Product Support**: By switching different `content` directories, multiple product documentations can be supported +* **Low-Code Integration**: Since content is separated from UI, we can more easily inject dynamic low-code component demos +* **Easy Updates**: Update the site engine by re-running init or updating the CLI version diff --git a/content/docs/getting-started/configuration.cn.mdx b/content/docs/getting-started/configuration.cn.mdx index 0de2003..48b88b5 100644 --- a/content/docs/getting-started/configuration.cn.mdx +++ b/content/docs/getting-started/configuration.cn.mdx @@ -13,7 +13,7 @@ ObjectDocs 遵循 **配置即代码 (Configuration as Code)** 的原则。所有 ### docs.site.json -主配置文件位于 `content/docs.site.json`。该文件控制整个文档站点的全局设置。 +主配置文件位于 `content/docs.site.json`。该文件控制整个文档站点的全局设置,并在构建和开发期间自动同步到 `content/.objectdocs`。 ```json { @@ -27,17 +27,34 @@ ObjectDocs 遵循 **配置即代码 (Configuration as Code)** 的原则。所有 "links": [ { "text": "Guide", "url": "/docs" }, { "text": "GitHub", "url": "https://github.com/objectstack-ai", "icon": "github" } - ] + ], + "i18n": { + "defaultLanguage": "en", + "languages": ["en", "zh-CN", "ja", "es", "fr", "de", "ko", "ru", "pt", "ar", "hi", "it", "tr", "vi"] + } } ``` +**工作原理:** +- 存储在 `content/docs.site.json` (你的内容目录) +- 在每次 build/dev 命令前复制到 `content/.objectdocs` +- 开发时监听 - 变化会触发服务器自动重启 +- 支持 14 种语言的国际化 + ### 配置项说明 | 属性 | 类型 | 说明 | | :--- | :--- | :--- | | `branding.name` | `string` | 站点名称,显示在导航栏左侧。 | -| `branding.logo` | `object` | 站点 Log 图片路径,支持亮色/暗色模式。 | +| `branding.logo` | `object` | 站点 Logo 图片路径,支持亮色/暗色模式。 | | `links` | `array` | 顶部导航栏链接列表。 | +| `i18n.defaultLanguage` | `string` | 默认语言代码 (例如, "en", "zh-CN")。 | +| `i18n.languages` | `array` | 支持的语言 (14种可选: en, zh-CN, ja, es, fr, de, ko, ru, pt, ar, hi, it, tr, vi)。 | + +**开发功能:** +- 配置更改在 `npm run dev` 期间自动检测 +- `docs.site.json` 被修改时服务器会重启 +- 配置更新无需手动重启 ## 目录与导航配置 diff --git a/content/docs/getting-started/configuration.mdx b/content/docs/getting-started/configuration.mdx index 66868ac..8e62e65 100644 --- a/content/docs/getting-started/configuration.mdx +++ b/content/docs/getting-started/configuration.mdx @@ -13,7 +13,7 @@ ObjectDocs follows the **Configuration as Code** principle. All site settings ar ### docs.site.json -The main configuration file is located at `content/docs.site.json`. This file controls the global settings for the entire documentation site. +The main configuration file is located at `content/docs.site.json`. This file controls the global settings for the entire documentation site and is automatically synced to `content/.objectdocs` during build and development. ```json { @@ -27,10 +27,20 @@ The main configuration file is located at `content/docs.site.json`. This file co "links": [ { "text": "Guide", "url": "/docs" }, { "text": "GitHub", "url": "https://github.com/objectstack-ai", "icon": "github" } - ] + ], + "i18n": { + "defaultLanguage": "en", + "languages": ["en", "zh-CN", "ja", "es", "fr", "de", "ko", "ru", "pt", "ar", "hi", "it", "tr", "vi"] + } } ``` +**How it Works:** +- Stored in `content/docs.site.json` (your content directory) +- Copied to `content/.objectdocs` before each build/dev command +- Watched during development - changes trigger automatic server restart +- Supports 14 languages for internationalization + ### Configuration Options | Property | Type | Description | @@ -38,6 +48,13 @@ The main configuration file is located at `content/docs.site.json`. This file co | `branding.name` | `string` | Site name, displayed on the left side of the navbar. | | `branding.logo` | `object` | Site logo image paths, supports light/dark mode. | | `links` | `array` | List of links in the top navigation bar. | +| `i18n.defaultLanguage` | `string` | Default language code (e.g., "en", "zh-CN"). | +| `i18n.languages` | `array` | Supported languages (14 available: en, zh-CN, ja, es, fr, de, ko, ru, pt, ar, hi, it, tr, vi). | + +**Development Features:** +- Config changes are automatically detected during `npm run dev` +- Server restarts when `docs.site.json` is modified +- No manual restart needed for configuration updates ## Directory & Navigation Configuration diff --git a/content/docs/getting-started/index.cn.mdx b/content/docs/getting-started/index.cn.mdx index c7093e2..92ae884 100644 --- a/content/docs/getting-started/index.cn.mdx +++ b/content/docs/getting-started/index.cn.mdx @@ -14,39 +14,45 @@ ObjectDocs 是一个基于 Next.js 14 和 Fumadocs 的现代文档引擎,支 - **Node.js**: 18.17 或更高版本 - **包管理器**: 推荐使用 pnpm (npm 或 yarn 也可以) -## 1. 创建新项目 +## 1. 初始化 ObjectDocs -我们提供了一个 CLI 工具来快速初始化项目。在你的终端中运行: +ObjectDocs 可以在任何现有项目中初始化,或作为新的独立项目。 -### 初始化目录结构 +### 方式 A: 使用 npm init (推荐) -在你的项目根目录下,创建以下文件结构: +最快速的入门方式: -```bash -mkdir -p content/docs +```bash title="Terminal" +mkdir my-docs +cd my-docs +npm init @objectdocs ``` -### 安装依赖 +这将自动运行初始化命令并设置所有必需的内容。 + +### 方式 B: 使用 npx -安装 `@objectdocs/cli` 作为开发依赖: +在现有项目中初始化: ```bash title="Terminal" -pnpm add -D @objectdocs/cli +cd your-existing-project +npx @objectdocs/cli init ``` -### 配置启动脚本 +这将: +- 从 `@objectdocs/site` 复制站点引擎到 `content/.objectdocs` +- 创建 `content/package.json` 并添加脚本 (`dev`, `build`, `start`) +- 在 `content/.objectdocs` 中安装依赖 +- 将 `content/.objectdocs` 和 `content/node_modules` 添加到 `.gitignore` +- 保持项目根目录整洁 -在 `package.json` 中添加以下脚本: +### 创建内容目录 -```json title="package.json" -{ - "scripts": { - "dev": "objectdocs dev", - "build": "objectdocs build", - "start": "objectdocs start" - } -} +如果尚未创建: + +```bash title="Terminal" +mkdir -p content/docs ``` @@ -101,12 +107,19 @@ description: 你的新文档站点 ## 3. 启动开发服务器 -运行以下命令启动服务: +进入 content 目录并启动开发服务器: ```bash title="Terminal" -pnpm dev +cd content +npm run dev ``` +开发服务器将: +- 在端口 7777 上启动(默认) +- 监听 `content/docs.site.json` 的变化并自动重启 +- 热重载你的 MDX 内容更改 +- 复制 `public/` 资源到站点引擎 + 现在访问 [http://localhost:7777](http://localhost:7777),你应该能看到你的文档站点了! ## 下一步 diff --git a/content/docs/getting-started/index.mdx b/content/docs/getting-started/index.mdx index 26238a0..d62d52b 100644 --- a/content/docs/getting-started/index.mdx +++ b/content/docs/getting-started/index.mdx @@ -14,39 +14,45 @@ Ensure your environment meets the following requirements: - **Node.js**: 18.17 or higher - **Package Manager**: pnpm is recommended (npm or yarn also work) -## 1. Create a New Project +## 1. Initialize ObjectDocs -We provide a CLI tool to quickly initialize your project. Run the following in your terminal: +ObjectDocs can be initialized in any existing project or as a new standalone project. -### Initialize Directory Structure +### Option A: Using npm init (Recommended) -In your project root, create the following file structure: +The fastest way to get started: -```bash -mkdir -p content/docs +```bash title="Terminal" +mkdir my-docs +cd my-docs +npm init @objectdocs ``` -### Install Dependencies +This automatically runs the init command and sets up everything you need. + +### Option B: Using npx -Install `@objectdocs/cli` as a development dependency: +Initialize in an existing project: ```bash title="Terminal" -pnpm add -D @objectdocs/cli +cd your-existing-project +npx @objectdocs/cli init ``` -### Configure Scripts +This will: +- Copy the site engine from `@objectdocs/site` to `content/.objectdocs` +- Create `content/package.json` with scripts (`dev`, `build`, `start`) +- Install dependencies in `content/.objectdocs` +- Add `content/.objectdocs` and `content/node_modules` to `.gitignore` +- Keep your project root clean -Add the following scripts to your `package.json`: +### Create Content Directory -```json title="package.json" -{ - "scripts": { - "dev": "objectdocs dev", - "build": "objectdocs build", - "start": "objectdocs start" - } -} +If not already created: + +```bash title="Terminal" +mkdir -p content/docs ``` @@ -101,12 +107,19 @@ Create `content/docs.site.json` to configure site name and navigation: ## 3. Start Development Server -Run the following command to start the service: +Navigate to the content directory and start the development server: ```bash title="Terminal" -pnpm dev +cd content +npm run dev ``` +The development server will: +- Start on port 7777 (default) +- Watch for changes in `content/docs.site.json` and automatically restart +- Hot reload your MDX content changes +- Copy `public/` assets to the site engine + Now visit [http://localhost:7777](http://localhost:7777), and you should see your documentation site! ## Next Steps diff --git a/content/docs/index.cn.mdx b/content/docs/index.cn.mdx index 9c30e94..3257147 100644 --- a/content/docs/index.cn.mdx +++ b/content/docs/index.cn.mdx @@ -39,9 +39,16 @@ import { FileJson, Layers, Cpu, Zap } from 'lucide-react'; * **技术文档工程师**: 编写 `.mdx` 内容并管理本地 `meta.json` 进行排序。 * **平台架构师**: 配置全局 `content/docs.site.json` (品牌, 导航链接)。 -* **前端开发人员**: 仅在绝对必要时维护底层 UI 逻辑 (作为 npm 包引入)。 +* **前端开发人员**: 站点引擎作为独立包 (`@objectdocs/site`) 维护,隔离在 `content/.objectdocs` 中。 -### 2. 交互式组件 +### 2. 整洁集成 +ObjectDocs 设计为可添加到任何现有项目: +* 所有文档都在 `content/` 目录中 +* 站点引擎复制到 `content/.objectdocs` (gitignored) +* 你的项目根目录保持整洁 +* 仓库中没有散落的配置文件 + +### 3. 交互式组件 静态文本不足以展示低代码平台的能力。ObjectDocs 允许你在文档中直接挂载实时的组件演示。 ## 下一步 diff --git a/content/docs/index.mdx b/content/docs/index.mdx index c54f103..9c8e5d7 100644 --- a/content/docs/index.mdx +++ b/content/docs/index.mdx @@ -39,9 +39,16 @@ In traditional documentation sites, adding a new section often requires editing * **Technical Writers**: Write `.mdx` content and manage local `meta.json` for sorting. * **Platform Architects**: Configure global `content/docs.site.json` (branding, nav links). -* **Frontend Developers**: Maintain the base UI logic only when strictly necessary. +* **Frontend Developers**: Site engine is maintained as a separate package (`@objectdocs/site`), isolated in `content/.objectdocs`. -### 2. Interactive Components +### 2. Clean Integration +ObjectDocs is designed to be added to any existing project: +* All documentation lives in `content/` directory +* Site engine is copied to `content/.objectdocs` (gitignored) +* Your project root stays clean and unpolluted +* No configuration files scattered across your repository + +### 3. Interactive Components Static text is not enough to showcase the capabilities of a low-code platform. ObjectDocs allows you to mount live component demos directly in your docs. ## Next Steps From 3ad7f0f64a1379d0f93e8099e1e3fef2db908efd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 07:28:27 +0000 Subject: [PATCH 3/3] Fix broken links in documentation Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- content/docs/getting-started/index.cn.mdx | 4 ++-- content/docs/getting-started/index.mdx | 4 ++-- content/docs/index.cn.mdx | 2 +- content/docs/index.mdx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/content/docs/getting-started/index.cn.mdx b/content/docs/getting-started/index.cn.mdx index 92ae884..edcfa82 100644 --- a/content/docs/getting-started/index.cn.mdx +++ b/content/docs/getting-started/index.cn.mdx @@ -124,6 +124,6 @@ npm run dev ## 下一步 +- [架构详解](./architecture) - 了解 ObjectDocs 的目录结构和数据流 - [配置文件](./configuration) - 了解更多配置选项 -- [编写内容](./writing) - 学习 MDX 语法和组件使用 -- [部署](./deployment) - 将你的文档发布到生产环境 +- [组件](/docs/components/objectui-embed) - 在文档中嵌入交互式 ObjectUI 组件 diff --git a/content/docs/getting-started/index.mdx b/content/docs/getting-started/index.mdx index d62d52b..1e9d81d 100644 --- a/content/docs/getting-started/index.mdx +++ b/content/docs/getting-started/index.mdx @@ -124,6 +124,6 @@ Now visit [http://localhost:7777](http://localhost:7777), and you should see you ## Next Steps +- [Architecture](./architecture) - Understand ObjectDocs' directory structure and data flow - [Configuration](./configuration) - Learn more about configuration options -- [Writing Content](./writing) - Learn MDX syntax and component usage -- [Deployment](./deployment) - Publish your documentation to production +- [Components](/docs/components/objectui-embed) - Embed interactive ObjectUI components in your docs diff --git a/content/docs/index.cn.mdx b/content/docs/index.cn.mdx index 3257147..ceca30c 100644 --- a/content/docs/index.cn.mdx +++ b/content/docs/index.cn.mdx @@ -26,7 +26,7 @@ import { FileJson, Layers, Cpu, Zap } from 'lucide-react'; } title="低代码原生支持" - href="/docs/components" + href="/docs/components/objectui-embed" > 直接在 Markdown 中嵌入 JSON 模式。渲染由 ObjectQL 定义驱动的实时交互组件。 diff --git a/content/docs/index.mdx b/content/docs/index.mdx index 9c8e5d7..ff56a67 100644 --- a/content/docs/index.mdx +++ b/content/docs/index.mdx @@ -26,7 +26,7 @@ Unlike general-purpose static site generators (SSGs), ObjectDocs treats document } title="Low-Code Native" - href="/docs/components" + href="/docs/components/objectui-embed" > Directly embed JSON schemas in Markdown. Render live, interactive components powered by ObjectQL definitions.