typo3-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTYPO3 Documentation Skill
TYPO3 文档技能
Create and maintain TYPO3 extension documentation following official docs.typo3.org standards.
按照官方docs.typo3.org标准创建和维护TYPO3扩展文档。
Core Workflow
核心工作流程
To create or maintain TYPO3 documentation, follow these steps:
-
Run extraction first to analyze the codebase and identify documentation gaps:bash
scripts/extract-all.sh /path/to/extension scripts/analyze-docs.sh /path/to/extensionThis reveals what features exist vs. what is documented. -
Consult the appropriate reference file for the task
-
Use TYPO3-specific directives, not plain text
-
Runto check syntax
scripts/validate_docs.sh -
Runto build HTML output
scripts/render_docs.sh -
Verify rendered output (see Pre-Commit Checklist for required evidence)
-
Verify README.md and Documentation/ synchronization
Critical: When the user asks to "show docs", render and display HTML output, not raw RST.
要创建或维护TYPO3文档,请遵循以下步骤:
-
先运行提取脚本以分析代码库并找出文档缺失项:bash
scripts/extract-all.sh /path/to/extension scripts/analyze-docs.sh /path/to/extension这会显示已有的功能和已文档化的功能之间的差异。 -
查阅对应任务的参考文件
-
使用TYPO3专用指令,而非纯文本
-
运行检查语法
scripts/validate_docs.sh -
运行生成HTML输出
scripts/render_docs.sh -
验证渲染后的输出(请参考预提交检查清单获取所需验证依据)
-
验证README.md与Documentation/目录下内容的一致性
关键提示:当用户要求“展示文档”时,需渲染并显示HTML输出,而非原始RST文件。
Using Reference Documentation
参考文档使用指南
File Structure and Setup
文件结构与配置
When setting up documentation structure, consult for directory layout, file naming conventions, and required files.
references/file-structure.mdWhen configuring guides.xml, consult for build configuration, project metadata, and interlink settings.
references/guides-xml.mdWhen setting up editor configuration, consult for .editorconfig requirements, indentation rules, and line length limits.
references/coding-guidelines.md设置文档结构时,请查阅获取目录布局、文件命名规范和必填文件说明。
references/file-structure.md配置guides.xml时,请查阅了解构建配置、项目元数据和交叉链接设置。
references/guides-xml.md设置编辑器配置时,请查阅获取.editorconfig要求、缩进规则和行长度限制。
references/coding-guidelines.mdRST Syntax and Elements
RST语法与元素
When writing RST content, consult for heading levels, lists, tables, and basic formatting.
references/rst-syntax.mdWhen using inline code references, consult for text roles like , , , and .
references/text-roles-inline-code.md:php::file::guilabel::ref:When documenting code, consult for code blocks, literalinclude, confval directives, and PHP domain syntax.
references/code-structure-elements.mdWhen using TYPO3-specific directives, consult for confval, versionadded, versionchanged, deprecated, and other TYPO3 directives.
references/typo3-directives.mdWhen creating interactive content, consult for accordion, tabs, card-grid, and admonition directives.
references/content-directives.md编写RST内容时,请查阅了解标题层级、列表、表格和基础格式。
references/rst-syntax.md使用内联代码引用时,请查阅了解、、和等文本角色。
references/text-roles-inline-code.md:php::file::guilabel::ref:编写代码文档时,请查阅了解代码块、literalinclude、confval指令和PHP域语法。
references/code-structure-elements.md使用TYPO3专用指令时,请查阅了解confval、versionadded、versionchanged、deprecated等TYPO3指令。
references/typo3-directives.md创建交互式内容时,请查阅了解accordion、tabs、card-grid和admonition指令。
references/content-directives.mdImages and Screenshots
图片与截图
When adding screenshots, consult for image requirements, alt text, figure directives, zoom/lightbox options, and screenshot best practices.
references/screenshots.mdMANDATORY: When documenting backend modules, configuration screens, or UI workflows, you MUST take screenshots. Do not proceed without them. See "Screenshot Requirements" below.
添加截图时,请查阅了解图片要求、替代文本、figure指令、缩放/灯箱选项和截图最佳实践。
references/screenshots.md强制要求:当记录后端模块、配置界面或UI工作流时,必须截取截图。不得跳过此步骤。请参阅下方的“截图要求”。
Rendering and Deployment
渲染与部署
When rendering documentation locally, consult for Docker commands, live preview, and troubleshooting.
references/rendering.mdWhen deploying to docs.typo3.org, consult for webhook configuration, build triggers, and deployment verification.
references/intercept-deployment.md本地渲染文档时,请查阅了解Docker命令、实时预览和故障排除方法。
references/rendering.md部署到docs.typo3.org时,请查阅了解webhook配置、构建触发和部署验证步骤。
references/intercept-deployment.mdAdvanced Topics
进阶主题
When writing Architecture Decision Records, consult for ADR templates, directory structure, and RST formatting.
references/architecture-decision-records.mdWhen analyzing documentation coverage, consult for feature coverage methodology and gap analysis.
references/documentation-coverage-analysis.mdWhen extracting documentation from code, consult for automated extraction workflows and data flow.
references/extraction-patterns.mdWhen understanding TYPO3 extension structure, consult for file hierarchy and documentation priority weighting.
references/typo3-extension-architecture.md编写架构决策记录时,请查阅了解ADR模板、目录结构和RST格式。
references/architecture-decision-records.md分析文档覆盖率时,请查阅了解功能覆盖率方法和缺失项分析。
references/documentation-coverage-analysis.md从代码中提取文档时,请查阅了解自动提取工作流和数据流。
references/extraction-patterns.md了解TYPO3扩展结构时,请查阅了解文件层级和文档优先级权重。
references/typo3-extension-architecture.mdRunning Scripts
运行脚本
Documentation Validation
文档验证
To validate RST syntax before committing:
bash
scripts/validate_docs.sh /path/to/extension提交前验证RST语法:
bash
scripts/validate_docs.sh /path/to/extensionDocumentation Rendering
文档渲染
To render documentation to HTML:
bash
scripts/render_docs.sh /path/to/extension将文档渲染为HTML:
bash
scripts/render_docs.sh /path/to/extensionDocumentation Extraction
文档提取
To extract documentation data from all sources:
bash
scripts/extract-all.sh /path/to/extensionTo extract from specific sources:
bash
undefined从所有来源提取文档数据:
bash
scripts/extract-all.sh /path/to/extension从特定来源提取:
bash
undefinedExtract PHP API documentation
提取PHP API文档
scripts/extract-php.sh /path/to/extension
scripts/extract-php.sh /path/to/extension
Extract extension configuration (ext_emconf.php, ext_localconf.php)
提取扩展配置(ext_emconf.php、ext_localconf.php)
scripts/extract-extension-config.sh /path/to/extension
scripts/extract-extension-config.sh /path/to/extension
Extract Composer metadata
提取Composer元数据
scripts/extract-composer.sh /path/to/extension
scripts/extract-composer.sh /path/to/extension
Extract build configurations (CI, testing)
提取构建配置(CI、测试)
scripts/extract-build-configs.sh /path/to/extension
scripts/extract-build-configs.sh /path/to/extension
Extract project files (README, CHANGELOG)
提取项目文件(README、CHANGELOG)
scripts/extract-project-files.sh /path/to/extension
scripts/extract-project-files.sh /path/to/extension
Extract repository metadata (GitHub/GitLab)
提取仓库元数据(GitHub/GitLab)
scripts/extract-repo-metadata.sh /path/to/extension
undefinedscripts/extract-repo-metadata.sh /path/to/extension
undefinedDocumentation Analysis
文档分析
To analyze documentation coverage and identify gaps:
bash
scripts/analyze-docs.sh /path/to/extension分析文档覆盖率并找出缺失项:
bash
scripts/analyze-docs.sh /path/to/extensionAI Context Setup
AI环境设置
To add AGENTS.md template to Documentation/ folder:
bash
scripts/add-agents-md.sh /path/to/extension将AGENTS.md模板添加到Documentation/目录:
bash
scripts/add-agents-md.sh /path/to/extensionUsing Asset Templates
使用资源模板
AI Agent Context
AI Agent 环境
To provide AI assistants with documentation context, copy to the extension's folder. This template includes:
assets/AGENTS.mdDocumentation/- Documentation type and strategy
- Target audience definition
- File structure overview
- Style guidelines for AI-generated content
为AI助手提供文档上下文时,请将复制到扩展的目录。该模板包含:
assets/AGENTS.mdDocumentation/- 文档类型与策略
- 目标受众定义
- 文件结构概述
- AI生成内容的风格指南
Screenshot Requirements (MANDATORY)
截图要求(强制)
YOU MUST TAKE SCREENSHOTS when documenting any of the following. This is not optional:
| Documentation Topic | Screenshot Required |
|---|---|
| Backend module interfaces | ✅ YES - Show the module UI |
| Extension configuration screens | ✅ YES - Show settings location |
| Multi-step UI workflows | ✅ YES - One screenshot per step |
| TCA/FlexForm configurations | ✅ YES - Show resulting forms |
| Frontend visual output | ✅ YES - Show what users see |
| Error messages/states | ✅ YES - Help users identify issues |
记录以下内容时必须截取截图,无例外:
| 文档主题 | 是否需要截图 |
|---|---|
| 后端模块界面 | ✅ 是 - 展示模块UI |
| 扩展配置界面 | ✅ 是 - 展示设置位置 |
| 多步骤UI工作流 | ✅ 是 - 每个步骤一张截图 |
| TCA/FlexForm配置 | ✅ 是 - 展示生成的表单 |
| 前端视觉输出 | ✅ 是 - 展示用户看到的内容 |
| 错误消息/状态 | ✅ 是 - 帮助用户识别问题 |
Screenshot Workflow
截图工作流程
- Before writing documentation: Identify which screens need screenshots
- Set up screenshot environment: Use Docker container or DDEV
- Take screenshots: PNG format, 1400x1050 or cropped
- Add to documentation: Use figure directive with and
:zoom: lightbox:alt: - Verify in rendered output: Confirm images display correctly
- 编写文档前:确定需要截图的界面
- 设置截图环境:使用Docker容器或DDEV
- 截取截图:PNG格式,1400x1050像素或裁剪至相关区域
- 添加到文档:使用figure指令,添加和
:zoom: lightbox:alt: - 在渲染输出中验证:确认图片显示正常
Taking Screenshots
截取截图
Using browser DevTools (Chrome/Firefox):
bash
undefined使用浏览器开发者工具(Chrome/Firefox):
bash
undefinedOpen DevTools (F12), then:
打开开发者工具(F12),然后:
Ctrl+Shift+P → "Capture screenshot" or "Capture full size screenshot"
Ctrl+Shift+P → “Capture screenshot”或“Capture full size screenshot”
**Using Playwright MCP (automated):**mcp__playwright__browser_take_screenshot
**Using Chrome DevTools MCP:**mcp__chrome-devtools__take_screenshot
undefined
**使用Playwright MCP(自动化):**mcp__playwright__browser_take_screenshot
**使用Chrome DevTools MCP:**mcp__chrome-devtools__take_screenshot
undefinedScreenshot Checklist (verify before proceeding)
截图检查清单(继续前请验证)
- PNG format used
- Light theme in TYPO3 backend
- Cropped to relevant area
- text describes image content
:alt: - added for click-to-enlarge
:zoom: lightbox - for visual polish
:class: with-border with-shadow - Image stored in with CamelCase name
Documentation/Images/
DO NOT write "TODO: add screenshot" or skip screenshots. If you cannot take a screenshot, explicitly ask the user to provide one or use the MCP tools to capture them.
- 使用PNG格式
- TYPO3后端使用浅色主题
- 裁剪至相关区域
- 文本描述图片内容
:alt: - 添加支持点击放大
:zoom: lightbox - 添加提升视觉效果
:class: with-border with-shadow - 图片存储在目录,采用驼峰式命名
Documentation/Images/
禁止写入“TODO: add screenshot”或跳过截图。如果无法截取截图,请明确要求用户提供,或使用MCP工具进行捕获。
Critical Rules
关键规则
- UTF-8 encoding, 4-space indentation, 80 character max line length, LF line endings
- CamelCase for file and directory names, sentence case for headings
- Index.rst required in every subdirectory
- PNG format for screenshots with text and
:alt::zoom: lightbox - .editorconfig required in directory
Documentation/
- 使用UTF-8编码、4空格缩进、每行最多80字符、LF换行符
- 文件和目录名采用驼峰式,标题采用句首大写格式
- 每个子目录必须包含Index.rst
- 截图采用PNG格式,需添加文本和
:alt::zoom: lightbox - 目录下必须包含**.editorconfig**
Documentation/
Element Selection Guide
元素选择指南
| Content Type | Directive to Use |
|---|---|
| Code (5+ lines) | |
| Short code snippets | |
| Configuration options | |
| PHP API documentation | |
| Important notices | |
| Feature grids | |
| Alternative approaches | |
| Collapsible content | |
| UI/Backend screenshots | |
| Tutorial steps | |
| Technical diagrams | |
| 内容类型 | 应使用的指令 |
|---|---|
| 代码(5行以上) | |
| 短代码片段 | |
| 配置选项 | |
| PHP API文档 | |
| 重要提示 | |
| 功能网格 | |
| 替代方案 | |
| 可折叠内容 | |
| UI/后端截图 | |
| 教程步骤 | |
| 技术图表 | |
Pre-Commit Checklist
预提交检查清单
- exists in
.editorconfigDocumentation/ - Every directory has with CamelCase naming
Index.rst - 4-space indentation, no tabs, max 80 characters per line
- Code blocks have and valid syntax highlighting
:caption: - Inline code uses appropriate roles (,
:php:,:file:):typoscript: - Screenshots exist for all backend modules, config screens, and UI workflows
- All images have text and
:alt:(or appropriate zoom mode):zoom: lightbox - passes without errors
scripts/validate_docs.sh - Render verification evidence required - After , verify and confirm:
scripts/render_docs.sh- No warnings or errors in render output
- Card grids display correctly (no broken layouts)
- Cross-references resolve (no broken links)
:ref: - Images/screenshots load and display
- README ↔ Documentation sync verified - After edits, confirm:
- Feature descriptions match between README.md and Documentation/Index.rst
- Installation instructions are identical
- Configuration examples are consistent
- Version/compatibility info is synchronized
- 目录下存在
Documentation/.editorconfig - 每个目录都有驼峰式命名的
Index.rst - 使用4空格缩进,无制表符,每行最多80字符
- 代码块包含和有效的语法高亮
:caption: - 内联代码使用合适的角色(、
:php:、:file:):typoscript: - 所有后端模块、配置界面和UI工作流均已添加截图
- 所有图片都有文本和
:alt:(或合适的缩放模式):zoom: lightbox - 运行无错误
scripts/validate_docs.sh - 需要提供渲染验证依据 - 运行后,需验证并确认:
scripts/render_docs.sh- 渲染输出无警告或错误
- 卡片网格显示正常(无布局错乱)
- 交叉引用可正确解析(无失效的链接)
:ref: - 图片/截图可正常加载显示
- 已验证README与文档内容同步 - 编辑后需确认:
- README.md与Documentation/Index.rst中的功能描述一致
- 安装说明完全相同
- 配置示例保持一致
- 版本/兼容性信息同步
External Resources
外部资源
When understanding TYPO3 documentation standards, consult the TYPO3 Documentation Writing Guide.
When seeking rendering tool documentation, consult the TYPO3 Documentation Rendering.
When checking directive syntax, consult the TYPO3 Documentation Reference.
Contributing: https://github.com/netresearch/typo3-docs-skill