Skip to content

docs: switch documentation to Clarify with minimal configuration - #5648

Open
yinxulai wants to merge 8 commits into
apolloconfig:masterfrom
yinxulai:clarify
Open

docs: switch documentation to Clarify with minimal configuration#5648
yinxulai wants to merge 8 commits into
apolloconfig:masterfrom
yinxulai:clarify

Conversation

@yinxulai

@yinxulai yinxulai commented Jul 22, 2026

Copy link
Copy Markdown

What's the purpose of this PR

Upgrade the Apollo documentation experience from the legacy Docsify presentation to Clarify with a deliberately minimal integration. Existing Markdown content remains unchanged and continues to be the source of truth; Clarify reads it directly from docs/.

A single JSON configuration provides the full site experience: bilingual navigation, grouped sections, search, light/dark themes, responsive layouts, footer links, and localized routes. This keeps future documentation work focused on content instead of site-specific scripts and injected UI configuration.

Which issue(s) this PR fixes

Fixes #5638

Brief changelog

  • Add docs/clarify.json with site metadata, English and Chinese locales, navigation, footer links, and layout settings.
  • Add minimal npm scripts for local development and production builds.
  • Ignore Clarify dependencies, generated output, and local logs.
  • Keep all existing documentation content unchanged.

Local development

Prerequisite: Node.js and npm.

cd docs
npm install
npm run dev

Open the URL printed by the command and visit /README, for example http://localhost:5173/README. If that port is already in use, Clarify automatically selects another one.

The development server watches documentation and configuration files and refreshes the site as they change.

Production build

cd docs
npm install
npm run build

The generated static site is written to docs/output/.

Validation

  • Started the development server with npm run dev.
  • Confirmed Clarify discovered and indexed 76 existing documentation pages.
  • Confirmed the JSON configuration loads bilingual navigation, search, theme controls, and footer links.

Preview

Apollo documentation powered by Clarify Apollo documentation page powered by Clarify

Checklist

  • Read the Contributing Guide.
  • Added a detailed description of what changed, how it works, and why.
  • Verified the documentation development server and generated navigation.
  • Run mvn clean test (not required for this documentation-only change).
  • Run mvn spotless:apply (not applicable to JSON/package metadata only).
  • Update CHANGES.md after the PR URL is available.

Summary by CodeRabbit

  • Documentation
    • Added configuration for the Apollo Documentation site, including English and Chinese navigation, page tabs, footer links, copyright text, and theme layout.
    • Added documentation site development and build commands.
  • Chores
    • Updated repository exclusions to keep generated documentation output, logs, and installed documentation packages out of version control.

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jul 22, 2026
@github-actions

Copy link
Copy Markdown

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d0a29aec-3ccb-4fd7-8a1c-c579c7eded90

📥 Commits

Reviewing files that changed from the base of the PR and between 34541d5 and 7ae241d.

📒 Files selected for processing (2)
  • docs/clarify.json
  • docs/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/package.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The update adds Clarify tooling and configuration for the documentation site. It defines bilingual navigation, footer links, locale settings, theme layout, package scripts, and ignore rules for generated documentation files.

Changes

Documentation configuration

Layer / File(s) Summary
Clarify tooling and generated-output setup
.gitignore, docs/package.json
The docs package adds Clarify development and build scripts and the @clarify-labs/cli dependency. Git ignores Clarify-generated files and directories.
Clarify site configuration
docs/clarify.json
The site configuration adds metadata, multilingual navigation, footer links, English and Chinese locale settings, and the default theme layout.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 7ae24

This PR replaces the documentation presentation with a minimal Clarify configuration while preserving existing Markdown content. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR implements the Clarify migration requested in [#5638] and adds configuration for multilingual, self-hosted documentation. However, the reported navigation.links validation error prevents the … Remove or replace the unsupported navigation.links configuration, then verify that npm run build completes successfully and produces the intended deployment artifacts for [#5638].
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: switching the documentation site to Clarify with minimal configuration.
Out of Scope Changes check ✅ Passed The changed files support the Clarify documentation migration. The .gitignore entries, Clarify configuration, and package scripts are within the stated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The PR implements the Clarify migration requested in [#5638] and adds configuration for multilingual, self-hosted documentation. However, the reported navigation.links validation error prevents the documented production build from completing, so the static-site migration is not yet functional.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yinxulai yinxulai changed the title Switch documentation to the new Clarify site draft: Switch documentation to the new Clarify site Jul 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/en/quick-start.mdx`:
- Around line 1-7: Replace the unfinished placeholder content in
docs/en/quick-start.mdx lines 1-7 with the restored English quick-start
documentation, or remove that page from navigation. Apply the same correction to
docs/zh/quick-start.mdx lines 1-7 using restored Chinese content, or remove it
from navigation; both localized pages must no longer expose placeholders.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e374e3a2-4200-4a1b-9a30-1b10c35614ab

📥 Commits

Reviewing files that changed from the base of the PR and between cdaedad and 2875aef.

⛔ Files ignored due to path filters (2)
  • doc/package-lock.json is excluded by !**/package-lock.json
  • docs/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • .gitignore
  • docs/.nojekyll
  • docs/clarify-env.d.ts
  • docs/clarify.ts
  • docs/css/buble.css
  • docs/css/dark.css
  • docs/css/fonts.css
  • docs/css/pure.css
  • docs/css/vue.css
  • docs/en/deployment/quick-start-docker.mdx
  • docs/en/deployment/quick-start.mdx
  • docs/en/quick-start.mdx
  • docs/index.html
  • docs/package.json
  • docs/scripts/multiple-language-redirect.js
  • docs/zh/README.mdx
  • docs/zh/deployment/quick-start-docker.mdx
  • docs/zh/deployment/quick-start.mdx
  • docs/zh/quick-start.mdx
💤 Files with no reviewable changes (6)
  • docs/css/pure.css
  • docs/css/vue.css
  • docs/css/buble.css
  • docs/css/dark.css
  • docs/css/fonts.css
  • docs/scripts/multiple-language-redirect.js

Comment thread docs/en/quick-start.mdx Outdated
Comment on lines +1 to +7
# Prepare

Wait for content...

```bash
content for copy
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Restore or unpublish both placeholder quick-start pages.

Both localized root pages contain unfinished placeholder text rather than documentation.

  • docs/en/quick-start.mdx#L1-L7: restore the English quick-start content or remove the page from navigation.
  • docs/zh/quick-start.mdx#L1-L7: restore the Chinese quick-start content or remove the page from navigation.
📍 Affects 2 files
  • docs/en/quick-start.mdx#L1-L7 (this comment)
  • docs/zh/quick-start.mdx#L1-L7
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/en/quick-start.mdx` around lines 1 - 7, Replace the unfinished
placeholder content in docs/en/quick-start.mdx lines 1-7 with the restored
English quick-start documentation, or remove that page from navigation. Apply
the same correction to docs/zh/quick-start.mdx lines 1-7 using restored Chinese
content, or remove it from navigation; both localized pages must no longer
expose placeholders.

@yinxulai

Copy link
Copy Markdown
Author

#5638

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jul 25, 2026
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jul 25, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/package.json (1)

8-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the docs toolchain reproducible.

Please verify that a lockfile is committed for the docs package and used by CI; otherwise the caret range on Line 9 can allow later CLI releases to change the build. If no lockfile is intended, pin the CLI version explicitly. npm recommends committing lockfiles for reproducible CI installs, and npm ci requires one. (docs.npmjs.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/package.json` around lines 8 - 10, Make the docs toolchain reproducible
by ensuring the docs package has a committed lockfile that CI uses with npm ci;
if a lockfile is not intended, replace the caret range for `@clarify-labs/cli` in
devDependencies with an exact pinned version.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/package.json`:
- Around line 8-10: Make the docs toolchain reproducible by ensuring the docs
package has a committed lockfile that CI uses with npm ci; if a lockfile is not
intended, replace the caret range for `@clarify-labs/cli` in devDependencies with
an exact pinned version.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f1851b5c-14e5-4dea-85df-fff3f5963744

📥 Commits

Reviewing files that changed from the base of the PR and between 6cd90bf and 34541d5.

📒 Files selected for processing (2)
  • docs/clarify.json
  • docs/package.json

@yinxulai

Copy link
Copy Markdown
Author

@nobodyiam 我提供了一个极小的 PR 来完成了初步的尝试,对文档内容零改动,我提供了一份站点配置(甚至也是可选的,我只是为了让目录看起来更友好),对于 packages.json 来说,也不是必须的,可以通过在 ci 中安装并使用 clarify 来构建项目是一样的,除此之外,有非常大量的关于 docsify 的配置和奇怪的注入类代码都可以删除,使用 clarify 可以让团队只需要关注文档内容。

@yinxulai yinxulai changed the title draft: Switch documentation to the new Clarify site docs: switch documentation to Clarify with minimal configuration Jul 25, 2026
@nobodyiam

nobodyiam commented Aug 1, 2026

Copy link
Copy Markdown
Member

感谢提交这个方案。Clarify 在面向 LLM 的文档体验上做了不少有价值的工作,例如提供 Markdown 视图、复制 Markdown、llms.txt 等能力,这个方向我比较认可。

不过,这些能力同时引入了文档构建和产物部署流程,这也是社区是否采纳时需要重点考虑的因素。Apollo 当前使用 Docsify,Markdown 文件可以直接在浏览器端渲染,仓库中只需维护文档源码,不需要为每次文档更新执行构建。类似这种轻量化模式对社区贡献者和后续维护会更友好一些。部分 LLM 友好能力,例如查看、复制原始 Markdown,也可以在 Docsify 现有模式下通过轻量插件补充。

另外,我目前按照 PR 中提供的步骤在本地执行 build 仍然不成功,因此暂时无法验证迁移后的完整页面效果、静态产物以及后续部署流程。建议先补充可复现的本地构建方式,并进一步说明构建产物如何在 CI 中生成和部署、是否需要提交到代码仓库,再评估完整的迁移成本和收益。

> build
> clarify build --content .

Error: [clarify] config field "navigation" is invalid: Unrecognized key: "links"
    at validateProjectConfig ($APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/engine-DJ8vzo23.js:1218:29)
    at validateClarifyConfig ($APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/engine-DJ8vzo23.js:1304:24)
    at loadJsonConfig ($APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/engine-DJ8vzo23.js:1299:9)
    at loadClarifyConfig ($APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/engine-DJ8vzo23.js:1313:43)
    at resolveProjectContext ($APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/engine-DJ8vzo23.js:3283:70)
    at $APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/engine-DJ8vzo23.js:3918:78
    at runPhase ($APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/engine-DJ8vzo23.js:3857:23)
    at async ClarifyEngine.initialize ($APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/engine-DJ8vzo23.js:3918:19)
    at async ClarifyEngine.prepare ($APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/engine-DJ8vzo23.js:3958:27)
    at async runBuild ($APOLLO_REPO_DIR/docs/node_modules/@clarify-labs/cli/output/cli.js:214:3)

@yinxulai

yinxulai commented Aug 26, 2026

Copy link
Copy Markdown
Author

感谢你非常细致的评审和建议,也感谢你对 Clarify 在 LLM 友好方向上的认可。
你提出的两个关键点我完全认同:一是社区维护模式要尽量轻量,二是迁移方案必须可复现、可验证。

先同步最新状态:之前本地遇到的构建报错(navigation 配置校验问题)已经通过升级到最新版本解决,当前构建流程可以正常执行。

关于方案定位,我想补充 Clarify 在这个 PR 中的使用方式和边界:

  1. 这套方案本质是文档发布层,不是让仓库承担额外复杂的站点工程。
  2. 推荐做法是在 CI(GitHub Actions)中安装并执行 Clarify,把文档目录里的 Markdown 生成静态站点用于部署。
  3. 对仓库贡献者而言,日常工作仍然主要是维护文档内容本身,可以把绝大多数精力放在 md 内容质量上,而不是构建细节。
  4. 构建产物建议由 CI 生成并发布,不需要回写到仓库主分支,从而保持仓库干净、协作成本低。

同时,Clarify 带来的能力不只是页面渲染替换,还包括:

  1. 原生多语言文档组织与路由。
  2. OpenAPI 作为一等内容层,可与指南内容融合,而非割裂在单独区域。
  3. 面向 AI 与工具链的产物支持,例如 llms.txt、搜索或 MCP 索引、可消费的结构化输出。
  4. 开源、源码自有、静态可自托管,仍然保留 Git 工作流下的可审阅和可追溯性。

以 Clarify 的官网内容示例:

内容操作菜单:
image

如果项目有接口文档,那 Clarify 更加适合:

  • 几乎 100% 的 openapi 语义生成文档覆盖
  • 在线的请求测试工具
image image

@yinxulai

Copy link
Copy Markdown
Author

当前这个 PR 只代表一个最小可用体验(minimal experience),用于验证文档内容零改动前提下能否完成接入与构建,不代表 Clarify 的最佳项目实践形态。

在实际生产使用里,Clarify 官方文档目前采用的是 Cloudflare Pages 自动追踪仓库变更并触发文档更新,这是一种免费、稳定且体验很好的发布方案。
如果团队更偏向 GitHub 生态,也可以使用 GitHub Actions 加 GitHub Pages 完成自动构建与发布,这条路径同样成熟易用。

也就是说,Clarify 的接入方式可以根据项目偏好选择,不绑定单一部署方案;无论选择 Cloudflare Pages 还是 GitHub Actions 加 Pages,都可以把仓库重心继续放在 Markdown 内容维护本身。

这一切成立的前提是 Clarify 最终交付的是纯静态 HTML 产物,因此天然适配 CDN 与静态托管链路,同时对搜索引擎抓取和 SEO 也非常友好。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

是否愿意考虑基于 Clarify 迁移项目文档?

2 participants