ui-sdk-write-docs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Write ui-sdk Docs

编写 ui-sdk 文档

Write in the website's current style. This skill is for contributors working on the website.
Size the work to the request. For a small edit, such as a sentence, caption, or typo, read the writing guide and the section you're changing, verify any API claim you change, and reread that section. For a new section, new page, or rewrite, follow the steps below. In either case, use only the checks the change reaches.
Honor the requested scope: a review produces findings, a draft stays in chat, and an edit changes files. Treat existing wording and structure as intentional. Preserve the maintainer's edits unless the request calls for revising them; suggest unrelated improvements separately.
按照网站当前的风格编写。本 skill 面向为网站提供内容的贡献者。
根据请求确定工作量。对于小改动,例如修改一个句子、图片说明或错别字,应读取写作指南和要修改的章节,验证改动中涉及的任何 API 声明,然后重读该章节。对于新章节、新页面或重写,请遵循以下步骤。无论属于哪种情况,仅执行此次改动涉及到的检查。
严格遵循请求的范围:审查应产出发现,草稿应保留在聊天中,而编辑应修改文件。将现有措辞和结构视为有意为之。除非请求明确要求修订,否则保留维护者所做的编辑;将无关的改进建议另行提出。

1. Read the Page and Its Reference

1. 阅读页面及其参考资料

Read Writing Website Docs and its main voice reference, Build a Component. Then read the page being changed and choose a reference for that page type from the guide. For a new page, read the neighboring pages so it continues what the reader already knows.
Identify what this page adds and which concepts can be linked instead of repeated.
阅读 网站文档写作指南 及其主要语气参考文档 Build a Component。然后阅读要修改的页面,并根据写作指南为该页面类型选择一个参考资料。对于新页面,阅读相邻页面,以确保它能延续读者已经掌握的内容。
确定该页面新增了哪些内容,以及哪些概念可以通过链接引用,而无需重复。

2. Check What the API Does

2. 检查 API 的行为

For behavior you introduce or change in the explanation, inspect the relevant exported types, implementation, and tests. This matters especially for defaults, persistence, cancellation, SSR, and hydration. Resolve mismatches against the actual behavior rather than assuming either prose or JSDoc is correct. Keep planned capabilities separate from shipped behavior.
When writing code examples, follow ui-sdk-write-code and the relevant framework conventions.
对于说明中新增或变更的行为,检查相关的导出类型、实现和测试。对于默认值、持久化、取消机制、SSR 和 hydration,这一点尤其重要。发现不一致时,应以实际行为为准,不要假定文档说明或 JSDoc 一定正确。将计划中的能力与已发布的行为区分开来。
编写代码示例时,请遵循 ui-sdk-write-code 和相关框架约定。

3. Write the Explanation

3. 编写说明

Apply the writing guide to the requested scope. For changes shared across framework pages, update the corresponding copies with each framework's actual API. Framework-specific changes stay in the affected framework.
根据请求范围应用写作指南。对于跨框架页面共享的改动,应根据每个框架的实际 API 更新相应副本。框架专属的改动仅应用于受影响的框架。

4. Read and Verify

4. 阅读并验证

Reread the changed section or page using the writing guide's final question. Check links, file titles, snippets, and generated references affected by the edit. Consult the docs-site guide for the implementation and the test guide for commands when these checks apply:
  • Walkthrough code: the React and Web Components
    docs-walkthrough
    tests extract code from Compose Behaviors and their Rendering pages. Check the extraction and run the affected tests when changing those snippets; update the tests if the documented behavior requires it.
  • Headings: keep
    TypeTable
    examples maps and incoming fragment links in sync with renamed headings. The maps derive anchors from heading text.
  • Component examples:
    tests/docs/props.spec.ts
    checks public API coverage in React examples. Preserve that coverage when replacing or removing examples, and check the corresponding framework copies.
  • Live demos: run the relevant specs under
    tests/docs/
    and try changed interactions in the rendered page. Check captions and layout stability. A prose-only edit doesn't need a new demo or a full browser sweep.
  • MDX rendering: for changes to MDX components, tables, or framework-specific blocks, check both the rendered page and its Markdown export.
Report what changed and what was verified, including checks you couldn't run.
使用写作指南中的最终问题重读已修改的章节或页面。检查受此次编辑影响的链接、文件标题、代码片段和生成的引用。在适用时,查阅 文档站点指南 了解实现方式,并查阅 测试指南 了解相关命令:
  • 演练代码: React 和 Web Components 的
    docs-walkthrough
    测试会从 Compose Behaviors 及其 Rendering 页面提取代码。修改这些代码片段时,请检查提取结果并运行受影响的测试;如果文档所描述的行为要求变更,则更新测试。
  • 标题: 使 TypeTable 示例映射和传入的 fragment 链接与重命名的标题保持同步。这些映射根据标题文本生成锚点。
  • 组件示例:
    tests/docs/props.spec.ts
    会检查 React 示例中的公开 API 覆盖情况。替换或删除示例时,应保留相应的覆盖范围,并检查对应框架的副本。
  • 实时演示: 运行
    tests/docs/
    下相关的 specs,并在渲染后的页面中测试改动后的交互。检查图片说明和布局稳定性。仅修改文案无需新增演示或进行完整的浏览器全面检查。
  • MDX 渲染: 修改 MDX 组件、表格或框架专属区块时,应同时检查渲染后的页面及其 Markdown 导出结果。
报告所做更改和已执行的验证,包括无法运行的检查。