infographic-syntax-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Infographic Syntax Creator

Infographic语法生成器

Overview

概述

Generate AntV Infographic syntax output from user content, following the rules in
references/prompt.md
.
根据
references/prompt.md
中的规则,从用户内容生成AntV Infographic语法输出。

Workflow

工作流程

  1. Read
    references/prompt.md
    for syntax rules, templates, and output constraints.
  2. Extract the user's key structure: title, desc, items, hierarchy, metrics; infer missing pieces if needed.
  3. Select a template that matches the structure (sequence/list/compare/hierarchy/chart).
  4. Compose the syntax using
    references/prompt.md
    as the formatting baseline.
  5. Preserve hard constraints in every output:
    • Output is a single
      plain
      code block; no extra text.
    • First line is
      infographic <template-name>
      .
    • Use two-space indentation; key/value pairs are
      key value
      ; arrays use
      -
      .
    • Compare templates (
      compare-*
      ) must have exactly two root nodes with children.
  1. 阅读
    references/prompt.md
    以了解语法规则、模板和输出约束。
  2. 提取用户内容的关键结构:标题、描述、条目、层级、指标;必要时推断缺失的内容。
  3. 选择与该结构匹配的模板(序列/列表/对比/层级/图表)。
  4. references/prompt.md
    为格式基准编写语法。
  5. 所有输出必须遵守以下硬性约束:
    • 输出为单个
      plain
      代码块;无额外文本。
    • 第一行是
      infographic <template-name>
    • 使用两个空格缩进;键值对格式为
      key value
      ;数组使用
      -
    • 对比类模板(
      compare-*
      )必须包含恰好两个带有子节点的根节点。