oceanbase-formatting

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OceanBase Documentation Formatting

OceanBase 文档格式规范

This skill ensures all OceanBase documentation follows consistent formatting standards and markdown lint rules.
本规则确保所有OceanBase文档遵循统一的格式标准和Markdown lint规则。

Meta information format

元信息格式

Always use table format, NOT YAML frontmatter:
Description
description文档的内容描述。注意:句尾需要统一加句号。
keywords关键词,多个关键词之间用英文逗号隔开
dir-name这里填写希望在国内站文档中心目录上展示的名称
dir-name-en这里填写希望在海外站文档中心目录上展示的名称
tenant-typeMySQL Mode 或 Oracle Mode(两种模式均适用则不填写)
ddl-typeOnline DDL 或 Offline DDL(仅适用于内核 SQL 语句相关文档)
machine-translation标识机器翻译的文档(如有)
Important:
  • Default: Only fill description and keywords
  • Fill tenant-type only when document applies to specific mode
  • Do NOT delete machine-translation field if present
  • All descriptions must end with period (句号)
始终使用表格格式,不要使用YAML frontmatter:
Description
description文档的内容描述。注意:句尾需要统一加句号。
keywords关键词,多个关键词之间用英文逗号隔开
dir-name这里填写希望在国内站文档中心目录上展示的名称
dir-name-en这里填写希望在海外站文档中心目录上展示的名称
tenant-typeMySQL Mode 或 Oracle Mode(两种模式均适用则不填写)
ddl-typeOnline DDL 或 Offline DDL(仅适用于内核 SQL 语句相关文档)
machine-translation标识机器翻译的文档(如有)
重要说明:
  • 默认仅需填写 description 和 keywords
  • 仅当文档适用于特定模式时填写 tenant-type
  • 若存在 machine-translation 字段,请勿删除
  • 所有描述内容句尾必须加句号

Notice boxes

提示框

说明 (Explain) - For explanations

说明 (Explain) - 用于解释说明

Use for explaining complex concepts, providing background, or detailed clarifications:
<main id="notice" type='explain'> <h4>说明</h4> <p>不支持 <code>CREATE TABLE AS SELECT</code>。</p> </main>
用于解释复杂概念、提供背景信息或详细说明:
<main id="notice" type='explain'> <h4>说明</h4> <p>不支持 <code>CREATE TABLE AS SELECT</code>。</p> </main>

注意 (Notice) - For warnings

注意 (Notice) - 用于警告提示

Use for warnings, limitations, or important alerts:
<main id="notice" type='notice'> <h4>注意</h4> <p>不支持修改关联 OCP 的 <strong>OCP 名</strong> 和 <strong>服务地址</strong>。</p> </main>
Formatting:
  • Use single quotes for
    type
    attribute:
    type='explain'
    or
    type='notice'
  • Use
    <h4>
    for heading
  • Use
    <p>
    for content
  • Use
    <code>
    for inline code
  • Use
    <strong>
    for emphasis
用于提示警告、使用限制或重要提醒:
<main id="notice" type='notice'> <h4>注意</h4> <p>不支持修改关联 OCP 的 <strong>OCP 名</strong> 和 <strong>服务地址</strong>。</p> </main>
格式要求:
  • type
    属性使用单引号:
    type='explain'
    type='notice'
  • 标题使用
    <h4>
    标签
  • 内容使用
    <p>
    标签
  • 行内代码使用
    <code>
    标签
  • 需要强调的内容使用
    <strong>
    标签

Spacing rules

间距规则

Follow these spacing requirements:
  1. Title and body: Space between title and body text
  2. Body and code blocks: Space between body text and code blocks
  3. Body and tables: Space between body text and tables
  4. Sections: Space between major sections
Example:
markdown
undefined
请遵循以下间距要求:
  1. 标题与正文:标题和正文内容之间需空行
  2. 正文与代码块:正文内容和代码块之间需空行
  3. 正文与表格:正文内容和表格之间需空行
  4. 章节之间:主要章节之间需空行
示例:
markdown
undefined

Syntax

Syntax

sql
ALTER SYSTEM KILL SESSION 'session_id';
sql
ALTER SYSTEM KILL SESSION 'session_id';

Parameters

Parameters

undefined
undefined

Markdown lint compliance

Markdown lint 合规要求

  • Use proper heading hierarchy (#, ##, ###)
  • Code blocks must specify language:
    sql, 
    json, etc.
  • Tables should have proper alignment
  • Lists should use consistent formatting
  • No trailing whitespace
  • Proper line breaks
  • 使用正确的标题层级(#, ##, ###)
  • 代码块必须指定语言:
    sql, 
    json 等
  • 表格应有正确的对齐方式
  • 列表使用统一的格式
  • 无尾部空格
  • 换行符使用规范

Video cards

视频卡片

For video content:
<div role="videolist"> <a role='video' data-code='在 boss 后台获取视频的 code' href='视频地址'> <img src='图标地址'/> 填写需要在卡片里展示的文案 </a> <a role='link' href='链接地址'> <img src='图标地址'/> 填写需要在卡片里展示的文案 </a> </div>
针对视频内容使用如下格式:
<div role="videolist"> <a role='video' data-code='在 boss 后台获取视频的 code' href='视频地址'> <img src='图标地址'/> 填写需要在卡片里展示的文案 </a> <a role='link' href='链接地址'> <img src='图标地址'/> 填写需要在卡片里展示的文案 </a> </div>

Download cards

下载卡片

For download links:
<div role="videolist"> <a role='link' href='链接地址'> <img src='图标地址'/> 填写需要在卡片里展示的文案 </a> </div>
Download icon URL:
text
https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/download.png
Notes:
  • Use
    role='link'
    for direct file downloads
  • Each
    <a>
    tag represents one card
  • Use the provided download icon URL for download cards
针对下载链接使用如下格式:
<div role="videolist"> <a role='link' href='链接地址'> <img src='图标地址'/> 填写需要在卡片里展示的文案 </a> </div>
下载图标地址:
text
https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/download.png
注意事项:
  • 直接文件下载使用
    role='link'
  • 每个
    <a>
    标签对应一张卡片
  • 下载卡片请使用提供的下载图标地址

Code block formatting

代码块格式

For existing code (code references)

现有代码(代码引用)

Use this format when referencing existing code:
text
startLine:endLine:filepath
// code content here
Requirements:
  • Include startLine and endLine (required)
  • Include full filepath (required)
  • Include at least 1 line of actual code
  • Do NOT add language tags
  • Do NOT indent triple backticks
引用现有代码时使用以下格式:
text
startLine:endLine:filepath
// code content here
要求:
  • 必须包含 startLine 和 endLine
  • 必须包含完整的文件路径
  • 至少包含1行实际代码
  • 不要添加语言标签
  • 三个反引号不要缩进

For new code (markdown code blocks)

新增代码(Markdown代码块)

Use standard markdown with language tag:
sql
ALTER SYSTEM KILL SESSION 'session_id';
Requirements:
  • Always specify language
  • No line numbers
  • Do NOT indent triple backticks
使用带语言标签的标准Markdown格式:
sql
ALTER SYSTEM KILL SESSION 'session_id';
要求:
  • 必须指定语言
  • 不要加行号
  • 三个反引号不要缩进

Table formatting

表格格式

  • Include header row
  • Use proper alignment
  • Keep content concise
  • Use code formatting for technical terms in cells
Example:
ParameterDescription
session_idThe Client Session ID of the current session.
  • 包含表头行
  • 使用正确的对齐方式
  • 保持内容简洁
  • 单元格内的技术术语使用代码格式
示例:
ParameterDescription
session_idThe Client Session ID of the current session.

Quality checks

质量检查

Before finalizing:
  • Meta table format (not YAML)
  • Notice boxes use correct format
  • Proper spacing throughout
  • Markdown lint compliant
  • Code blocks have language tags
  • Tables properly formatted
  • No trailing whitespace
最终定稿前请检查:
  • 元数据表格式正确(未使用YAML)
  • 提示框使用正确格式
  • 全文间距符合要求
  • 符合Markdown lint规范
  • 代码块已标注语言标签
  • 表格格式正确
  • 无尾部空格