tiptap

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tiptap Integration Skill

Tiptap集成Skill

Instructions for coding agents integrating the Tiptap rich text editor
为编码Agent提供的Tiptap富文本编辑器集成指南

Reference Repositories

参考仓库

Clone the tiptap and tiptap-docs repositories so you can search the source code and documentation.
If the workspace already has a reference folder with other repositories, clone them there.
Otherwise, clone the repositories in a new
.reference
folder. The reference folder should be git-ignored.
Before you start a task, make sure the repositories are updated to the latest version.
克隆tiptap和tiptap-docs仓库,以便你可以搜索源代码和文档。
如果工作区已有包含其他仓库的参考文件夹,请将它们克隆到该文件夹中。
否则,将仓库克隆到新的
.reference
文件夹中。该参考文件夹应被git忽略。
开始任务前,请确保仓库已更新至最新版本。

Best Practices

最佳实践

General

通用原则

  • Use the latest stable version of Tiptap 3.
  • All packages that start with
    @tiptap/
    must have the same version number.
  • When integrating Tiptap for the first time, read the corresponding installation guide in tiptap-docs.
  • When server-side rendering (e.g. Next.js), set the
    immediatelyRender: false
    option when initializing the editor. Otherwise, the editor will crash. Learn more about this in tiptap-docs.
  • 使用最新稳定版的Tiptap 3
  • 所有以
    @tiptap/
    开头的包必须使用相同的版本号
  • 首次集成Tiptap时,请阅读tiptap-docs中的对应安装指南。
  • 进行服务端渲染(如Next.js)时,初始化编辑器需设置
    immediatelyRender: false
    选项,否则编辑器会崩溃。更多信息请查看tiptap-docs。

React

React相关

  • Prefer using the React Composable API. See
    tiptap-docs/src/content/guides/react-composable-api.mdx
  • 优先使用React Composable API。详见
    tiptap-docs/src/content/guides/react-composable-api.mdx

Implementing Editor Features

编辑器功能实现

When the user asks you to implement one of these features, read the corresponding section in tiptap-docs for guidance.
  • Real-time collaboration — Multiple users editing a document simultaneously. See
    tiptap-docs/src/content/collaboration/
    .
  • Comments — Thread-based inline and document comments. See
    tiptap-docs/src/content/comments/
    .
  • Tracked changes — Track, accept, and reject document edits. See
    tiptap-docs/src/content/tracked-changes/
    .
  • Import/Export — Convert documents to and from DOCX, PDF, Markdown, and other formats. See
    tiptap-docs/src/content/conversion/
    .
  • AI content generation — Generate text content into the document using AI. See
    tiptap-docs/src/content/content-ai/capabilities/ai-toolkit/workflows/insert-content.mdx
    .
  • AI agent document editing — Give an AI agent the ability to edit Tiptap documents. See
    tiptap-docs/src/content/content-ai/capabilities/ai-toolkit/
    .
  • AI review and proofreading — Review, proofread, and suggest style improvements. See
    tiptap-docs/src/content/content-ai/capabilities/ai-toolkit/workflows/proofreader.mdx
    .
  • AI server-side processing — Run AI workflows that edit rich text documents on the server. See
    tiptap-docs/src/content/content-ai/capabilities/server-ai-toolkit/
    .
  • Version history — Save and restore document snapshots. See
    tiptap-docs/src/content/collaboration/documents/snapshot.mdx
    .
  • Snapshot compare — Highlight differences between document versions. See
    tiptap-docs/src/content/collaboration/documents/snapshot-compare.mdx
    .
  • Pages — Print-ready page layout with headers, footers, and page breaks. See
    tiptap-docs/src/content/pages/
    .
当用户要求你实现以下功能之一时,请查看tiptap-docs中的对应章节获取指导。
  • 实时协作 — 多用户同时编辑文档。详见
    tiptap-docs/src/content/collaboration/
  • 评论功能 — 基于线程的行内和文档评论。详见
    tiptap-docs/src/content/comments/
  • 修订追踪 — 追踪、接受或拒绝文档编辑。详见
    tiptap-docs/src/content/tracked-changes/
  • 导入/导出 — 在DOCX、PDF、Markdown等格式之间转换文档。详见
    tiptap-docs/src/content/conversion/
  • AI内容生成 — 使用AI在文档中生成文本内容。详见
    tiptap-docs/src/content/content-ai/capabilities/ai-toolkit/workflows/insert-content.mdx
  • AI Agent文档编辑 — 赋予AI Agent编辑Tiptap文档的能力。详见
    tiptap-docs/src/content/content-ai/capabilities/ai-toolkit/
  • AI审阅与校对 — 审阅、校对文档并提出样式改进建议。详见
    tiptap-docs/src/content/content-ai/capabilities/ai-toolkit/workflows/proofreader.mdx
  • AI服务端处理 — 在服务端运行编辑富文本文档的AI工作流。详见
    tiptap-docs/src/content/content-ai/capabilities/server-ai-toolkit/
  • 版本历史 — 保存和恢复文档快照。详见
    tiptap-docs/src/content/collaboration/documents/snapshot.mdx
  • 快照对比 — 高亮显示文档版本之间的差异。详见
    tiptap-docs/src/content/collaboration/documents/snapshot-compare.mdx
  • 页面布局 — 支持页眉、页脚和分页符的可打印页面布局。详见
    tiptap-docs/src/content/pages/

Pro Extensions

Pro扩展

Some Tiptap extensions are distributed through a private npm registry. To install pro packages, see
tiptap-docs/src/content/guides/pro-extensions.mdx
for setup instructions.
部分Tiptap扩展通过私有npm仓库分发。如需安装Pro包,请查看
tiptap-docs/src/content/guides/pro-extensions.mdx
获取设置说明。