From 66b329df9b82df0e6ba8a6fe595d3d469ca4f9bc Mon Sep 17 00:00:00 2001 From: Yanggq <1041206149@qq.com> Date: Mon, 27 Oct 2025 19:53:49 +0800 Subject: [PATCH 1/2] fix: content_list_spec.md_4 --- .../output_format/content_list_spec.md | 279 ++++++++++-------- 1 file changed, 158 insertions(+), 121 deletions(-) diff --git a/docs/specification/output_format/content_list_spec.md b/docs/specification/output_format/content_list_spec.md index 2292c9a8..57842d03 100644 --- a/docs/specification/output_format/content_list_spec.md +++ b/docs/specification/output_format/content_list_spec.md @@ -21,50 +21,31 @@ [ { "type": "code", - "raw_content": "x = 1", - "inline": true, - "content": { - "code_content": "x = 1", - "language": "python", - "by": "highlightjs" - } - }, - { - "type": "code", - "raw_content": "def add(a, b):\n return a + b", + "raw_content": "def add(a, b):\\n return a + b", "inline": false, "content": { - "code_content": "def add(a, b):\n return a + b", - "language": "python", - "by": "highlightjs" - } - }, - { - "type": "equation-inline", - "raw_content": "E=mc^2", - "content": { - "math_content": "E=mc^2", - "math_type": "latex", - "by": "mathjax" + "code_content": "def add(a, b):\\n return a + b", + "by": "tag_code" } }, { "type": "equation-interline", - "raw_content": "a^2 + b^2 = c^2", + "raw_content": "

$$a^2 + b^2 = c^2$$

", "content": { "math_content": "a^2 + b^2 = c^2", "math_type": "latex", - "by": "mathjax" + "by": "mathjax_mock" } }, { "type": "image", - "raw_content": "\"示例图片\"", + "raw_content": "
\"Screen
What it ACTUALLY looks like
", "content": { - "url": "https://www.example.com/image.jpg", - "alt": "示例图片", - "title": "示例图片标题", - "caption": "图片说明文字" + "url": "http://static4.wikia.nocookie.net/__cb20120619225143/central/images/thumb/3/30/Screen_Shot_2012-06-19_at_6.25.45_PM.png/180px-Screen_Shot_2012-06-19_at_6.25.45_PM.png", + "data": null, + "alt": "Screen Shot 2012-06-19 at 6.25.45 PM", + "title": null, + "caption": "What it ACTUALLY looks like" } }, { @@ -78,44 +59,76 @@ }, { "type": "complex_table", - "raw_content": "
指标数据
20232024
营收1015
", + "raw_content": "
指标数据
20232024
营收1015
", "content": { - "html": "
指标数据
20232024
营收1015
", + "html": "
指标数据
20232024
营收1015
", "is_complex": true, - "table_nest_level": 1 + "table_nest_level": "1" } }, { "type": "list", - "raw_content": "", + "raw_content": "
外层列表项
  1. 行内公式: E=mc^2
  2. 行内代码: x = 1
外层另一个列表项
  • 第二层菜单项
  • ", "content": { "items": [ - [ - { "c": "You must be logged in to reply to this topic.", "t": "text" }, - { "c": "x = 1", "t": "code-inline" }, - { "c": "E=mc^2", "t": "equation-inline" } - ] + { + "c": "外层列表项" + }, + { + "child_list": { + "list_attribute": "ordered", + "items": [ + { + "c": "行内公式: $E=mc^2$" + }, + { + "c": "行内代码: `x = 1`" + } + ] + } + }, + { + "c": "外层另一个列表项" + }, + { + "child_list": { + "list_attribute": "unordered", + "items": [ + { + "c": "第二层菜单项" + } + ] + } + } ], - "list_attribute": "unordered", - "list_nest_level": 1 + "list_attribute": "definition", + "list_nest_level": "2" } }, { "type": "title", - "raw_content": "

    大模型好,大模型棒

    ", + "raw_content": "

    大模型好,大模型棒1

    ", "content": { - "title_content": "大模型好,大模型棒", - "level": 1 + "title_content": "大模型好,大模型棒1", + "level": "1" } }, { "type": "paragraph", - "raw_content": "Who Is In Your Top 3 Mentalists Of All Time? <code>x = 1</code> $E=mc^2$ • MAGICIANSANDMAGIC.COM", + "raw_content": "Who Is In Your Top 3 Mentalists Of All Time? <code>x = 1</code> <ccmath-inline type=\"latex\" by=\"mathjax_mock\" html=\"$E=mc^2$\">E=mc^2</ccmath-inline> • MAGICIANSANDMAGIC.COM", "content": [ - { "c": "Who Is In Your Top 3 Mentalists Of All Time?", "t": "text" }, - { "c": "x = 1", "t": "code-inline" }, - { "c": "E=mc^2", "t": "equation-inline" }, - { "c": "• MAGICIANSANDMAGIC.COM", "t": "text" } + { + "c": "Who Is In Your Top 3 Mentalists Of All Time? x = 1", + "t": "text" + }, + { + "c": "E=mc^2", + "t": "equation-inline" + }, + { + "c": "• MAGICIANSANDMAGIC.COM", + "t": "text" + } ] } ], @@ -129,14 +142,13 @@ ```json { - "type": "code", - "raw_content": "def add(a, b):\n return a + b", - "inline": false, - "content": { - "code_content": "def add(a, b):\n return a + b", - "language": "python", - "by": "highlightjs" - } + "type": "code", + "raw_content": "def add(a, b):\\n return a + b", + "inline": false, + "content": { + "code_content": "def add(a, b):\\n return a + b", + "by": "tag_code" + } } ``` @@ -153,13 +165,13 @@ ```json { - "type": "equation-interline", - "raw_content": "a^2 + b^2 = c^2", - "content": { - "math_content": "a^2 + b^2 = c^2", - "math_type": "latex", - "by": "mathjax" - } + "type": "equation-interline", + "raw_content": "

    $$a^2 + b^2 = c^2$$

    ", + "content": { + "math_content": "a^2 + b^2 = c^2", + "math_type": "latex", + "by": "mathjax_mock" + } } ``` @@ -175,15 +187,15 @@ ```json { - "type": "image", - "raw_content": null, - "content": { - "url": "https://www.example.com/image.jpg", - "data": "如果是base64形式的图片,则用这个字段,忽略url", - "alt": "example image", - "title": "example image", - "caption": "text from somewhere" - } + "type": "image", + "raw_content": "
    \"Screen
    What it ACTUALLY looks like
    ", + "content": { + "url": "http://static4.wikia.nocookie.net/__cb20120619225143/central/images/thumb/3/30/Screen_Shot_2012-06-19_at_6.25.45_PM.png/180px-Screen_Shot_2012-06-19_at_6.25.45_PM.png", + "data": null, + "alt": "Screen Shot 2012-06-19 at 6.25.45 PM", + "title": null, + "caption": "What it ACTUALLY looks like" + } } ``` @@ -254,13 +266,13 @@ ```json { - "type": "simple_table", // 可以选填simple_table、complex_table - "raw_content": null, - "content": { - "html": "
    12
    ", - "is_complex": false, // 是否是复杂表格(跨行、跨列的), 默认为false, - "table_nest_level": 1 //表格嵌套层级 - } + "type": "complex_table", + "raw_content": "
    指标数据
    20232024
    营收1015
    ", + "content": { + "html": "
    指标数据
    20232024
    营收1015
    ", + "is_complex": true, + "table_nest_level": "1" + } } ``` @@ -276,37 +288,53 @@ ```json { - "type": "list", - "raw_content": null, - "content": { - "items": [ //列表里只考虑文本和公式,如果有其他类型元素,列表就转为若干个段落,否则结构太复杂了 - [ //这是第一个item,每个item是个数组,数组里是段落,下面只有一个段落 - [ - {"c": "爱因斯坦的质量方差公式是", "t": "text"}, - {"c": "E=mc^2", "t": "equation-inline"}, - {"c": ",其中E是能量,m是质量,c是光速 ","t": "text"} - ] - ], - [ - [ - {"c": "第二项示例代码 sum(a)", "t": "text"}, - {"c": "sum(a)", "t": "code-inline"} - ] - ] - ], - "list_attribute": "ordered", - "list_nest_level": 1 - } + "type": "list", + "raw_content": "
    外层列表项
    1. 行内公式: E=mc^2
    2. 行内代码: x = 1
    外层另一个列表项
  • 第二层菜单项
  • ", + "content": { + "items": [ + { + "c": "外层列表项" + }, + { + "child_list": { + "list_attribute": "ordered", + "items": [ + { + "c": "行内公式: $E=mc^2$" + }, + { + "c": "行内代码: `x = 1`" + } + ] + } + }, + { + "c": "外层另一个列表项" + }, + { + "child_list": { + "list_attribute": "unordered", + "items": [ + { + "c": "第二层菜单项" + } + ] + } + } + ], + "list_attribute": "definition", + "list_nest_level": "2" + } } ``` -| 字段 | 类型 | 描述 | 是否必须 | -| ----------------------- | ------ | --------------------------------------------------- | -------- | -| type | string | 值固定为list | 是 | -| raw_content | string | 原始文本内容 | 可选 | -| content.items | array | 列表项,每个元素是N个段落,段落里的元素是文本或公式 | 是 | -| content.list_attribute | string | unordered/ordered/definition | 可选 | -| content.list_nest_level | int | list的嵌套层级(单层list list_nest_level为1) | 可选 | +| 字段 | 类型 | 描述 | 是否必须 | +| ----------------------- | ------ |-------------------------------------| -------- | +| type | string | 值固定为list | 是 | +| raw_content | string | 原始文本内容 | 可选 | +| content.items | array | 列表项,每个元素是N个段落,段落里的元素是文本、公式或代码 | 是 | +| content.list_attribute | string | unordered/ordered/definition | 可选 | +| content.list_nest_level | int | list的嵌套层级(单层list list_nest_level为1) | 可选 | items字段说明 @@ -318,12 +346,12 @@ ```json { - "type": "title", - "raw_content": null, - "content": { - "title_content": "大模型好,大模型棒", - "level": 1 // 标题级别,1-N, 1最大 - } + "type": "title", + "raw_content": "

    大模型好,大模型棒1

    ", + "content": { + "title_content": "大模型好,大模型棒1", + "level": "1" + } } ``` @@ -338,13 +366,22 @@ ```json { - "type": "paragraph", - "raw_content": null, - "content": [ - {"c": "爱因斯坦的质量方差公式是", "t": "text"}, - {"c": "E=mc^2", "t": "equation-inline"}, - {"c": ",其中E是能量,m是质量,c是光速 ","t": "text"} - ] + "type": "paragraph", + "raw_content": "Who Is In Your Top 3 Mentalists Of All Time? <code>x = 1</code> <ccmath-inline type=\"latex\" by=\"mathjax_mock\" html=\"$E=mc^2$\">E=mc^2</ccmath-inline> • MAGICIANSANDMAGIC.COM", + "content": [ + { + "c": "Who Is In Your Top 3 Mentalists Of All Time? x = 1", + "t": "text" + }, + { + "c": "E=mc^2", + "t": "equation-inline" + }, + { + "c": "• MAGICIANSANDMAGIC.COM", + "t": "text" + } + ] } ``` From 998f7172fd6c48c7b3113240655d7a4d5eb3f746 Mon Sep 17 00:00:00 2001 From: Yanggq <1041206149@qq.com> Date: Mon, 27 Oct 2025 20:04:10 +0800 Subject: [PATCH 2/2] fix: content_list_spec.md_4 --- .../output_format/content_list_spec.md | 279 ++++++++++-------- 1 file changed, 158 insertions(+), 121 deletions(-) diff --git a/docs/specification/output_format/content_list_spec.md b/docs/specification/output_format/content_list_spec.md index 2292c9a8..c46cdcd4 100644 --- a/docs/specification/output_format/content_list_spec.md +++ b/docs/specification/output_format/content_list_spec.md @@ -21,50 +21,31 @@ [ { "type": "code", - "raw_content": "x = 1", - "inline": true, - "content": { - "code_content": "x = 1", - "language": "python", - "by": "highlightjs" - } - }, - { - "type": "code", - "raw_content": "def add(a, b):\n return a + b", + "raw_content": "def add(a, b):\\n return a + b", "inline": false, "content": { - "code_content": "def add(a, b):\n return a + b", - "language": "python", - "by": "highlightjs" - } - }, - { - "type": "equation-inline", - "raw_content": "E=mc^2", - "content": { - "math_content": "E=mc^2", - "math_type": "latex", - "by": "mathjax" + "code_content": "def add(a, b):\\n return a + b", + "by": "tag_code" } }, { "type": "equation-interline", - "raw_content": "a^2 + b^2 = c^2", + "raw_content": "

    $$a^2 + b^2 = c^2$$

    ", "content": { "math_content": "a^2 + b^2 = c^2", "math_type": "latex", - "by": "mathjax" + "by": "mathjax_mock" } }, { "type": "image", - "raw_content": "\"示例图片\"", + "raw_content": "
    \"Screen
    What it ACTUALLY looks like
    ", "content": { - "url": "https://www.example.com/image.jpg", - "alt": "示例图片", - "title": "示例图片标题", - "caption": "图片说明文字" + "url": "http://static4.wikia.nocookie.net/__cb20120619225143/central/images/thumb/3/30/Screen_Shot_2012-06-19_at_6.25.45_PM.png/180px-Screen_Shot_2012-06-19_at_6.25.45_PM.png", + "data": null, + "alt": "Screen Shot 2012-06-19 at 6.25.45 PM", + "title": null, + "caption": "What it ACTUALLY looks like" } }, { @@ -78,44 +59,76 @@ }, { "type": "complex_table", - "raw_content": "
    指标数据
    20232024
    营收1015
    ", + "raw_content": "
    指标数据
    20232024
    营收1015
    ", "content": { - "html": "
    指标数据
    20232024
    营收1015
    ", + "html": "
    指标数据
    20232024
    营收1015
    ", "is_complex": true, - "table_nest_level": 1 + "table_nest_level": "1" } }, { "type": "list", - "raw_content": "", + "raw_content": "
    外层列表项
    1. 行内公式: E=mc^2
    2. 行内代码: x = 1
    外层另一个列表项
  • 第二层菜单项
  • ", "content": { "items": [ - [ - { "c": "You must be logged in to reply to this topic.", "t": "text" }, - { "c": "x = 1", "t": "code-inline" }, - { "c": "E=mc^2", "t": "equation-inline" } - ] + { + "c": "外层列表项" + }, + { + "child_list": { + "list_attribute": "ordered", + "items": [ + { + "c": "行内公式: $E=mc^2$" + }, + { + "c": "行内代码: `x = 1`" + } + ] + } + }, + { + "c": "外层另一个列表项" + }, + { + "child_list": { + "list_attribute": "unordered", + "items": [ + { + "c": "第二层菜单项" + } + ] + } + } ], - "list_attribute": "unordered", - "list_nest_level": 1 + "list_attribute": "definition", + "list_nest_level": "2" } }, { "type": "title", - "raw_content": "

    大模型好,大模型棒

    ", + "raw_content": "

    大模型好,大模型棒1

    ", "content": { - "title_content": "大模型好,大模型棒", - "level": 1 + "title_content": "大模型好,大模型棒1", + "level": "1" } }, { "type": "paragraph", - "raw_content": "Who Is In Your Top 3 Mentalists Of All Time? <code>x = 1</code> $E=mc^2$ • MAGICIANSANDMAGIC.COM", + "raw_content": "Who Is In Your Top 3 Mentalists Of All Time? <code>x = 1</code> <ccmath-inline type=\"latex\" by=\"mathjax_mock\" html=\"$E=mc^2$\">E=mc^2</ccmath-inline> • MAGICIANSANDMAGIC.COM", "content": [ - { "c": "Who Is In Your Top 3 Mentalists Of All Time?", "t": "text" }, - { "c": "x = 1", "t": "code-inline" }, - { "c": "E=mc^2", "t": "equation-inline" }, - { "c": "• MAGICIANSANDMAGIC.COM", "t": "text" } + { + "c": "Who Is In Your Top 3 Mentalists Of All Time? x = 1", + "t": "text" + }, + { + "c": "E=mc^2", + "t": "equation-inline" + }, + { + "c": "• MAGICIANSANDMAGIC.COM", + "t": "text" + } ] } ], @@ -129,14 +142,13 @@ ```json { - "type": "code", - "raw_content": "def add(a, b):\n return a + b", - "inline": false, - "content": { - "code_content": "def add(a, b):\n return a + b", - "language": "python", - "by": "highlightjs" - } + "type": "code", + "raw_content": "def add(a, b):\\n return a + b", + "inline": false, + "content": { + "code_content": "def add(a, b):\\n return a + b", + "by": "tag_code" + } } ``` @@ -153,13 +165,13 @@ ```json { - "type": "equation-interline", - "raw_content": "a^2 + b^2 = c^2", - "content": { - "math_content": "a^2 + b^2 = c^2", - "math_type": "latex", - "by": "mathjax" - } + "type": "equation-interline", + "raw_content": "

    $$a^2 + b^2 = c^2$$

    ", + "content": { + "math_content": "a^2 + b^2 = c^2", + "math_type": "latex", + "by": "mathjax_mock" + } } ``` @@ -175,15 +187,15 @@ ```json { - "type": "image", - "raw_content": null, - "content": { - "url": "https://www.example.com/image.jpg", - "data": "如果是base64形式的图片,则用这个字段,忽略url", - "alt": "example image", - "title": "example image", - "caption": "text from somewhere" - } + "type": "image", + "raw_content": "
    \"Screen
    What it ACTUALLY looks like
    ", + "content": { + "url": "http://static4.wikia.nocookie.net/__cb20120619225143/central/images/thumb/3/30/Screen_Shot_2012-06-19_at_6.25.45_PM.png/180px-Screen_Shot_2012-06-19_at_6.25.45_PM.png", + "data": null, + "alt": "Screen Shot 2012-06-19 at 6.25.45 PM", + "title": null, + "caption": "What it ACTUALLY looks like" + } } ``` @@ -254,13 +266,13 @@ ```json { - "type": "simple_table", // 可以选填simple_table、complex_table - "raw_content": null, - "content": { - "html": "
    12
    ", - "is_complex": false, // 是否是复杂表格(跨行、跨列的), 默认为false, - "table_nest_level": 1 //表格嵌套层级 - } + "type": "complex_table", + "raw_content": "
    指标数据
    20232024
    营收1015
    ", + "content": { + "html": "
    指标数据
    20232024
    营收1015
    ", + "is_complex": true, + "table_nest_level": "1" + } } ``` @@ -276,37 +288,53 @@ ```json { - "type": "list", - "raw_content": null, - "content": { - "items": [ //列表里只考虑文本和公式,如果有其他类型元素,列表就转为若干个段落,否则结构太复杂了 - [ //这是第一个item,每个item是个数组,数组里是段落,下面只有一个段落 - [ - {"c": "爱因斯坦的质量方差公式是", "t": "text"}, - {"c": "E=mc^2", "t": "equation-inline"}, - {"c": ",其中E是能量,m是质量,c是光速 ","t": "text"} - ] - ], - [ - [ - {"c": "第二项示例代码 sum(a)", "t": "text"}, - {"c": "sum(a)", "t": "code-inline"} - ] - ] - ], - "list_attribute": "ordered", - "list_nest_level": 1 - } + "type": "list", + "raw_content": "
    外层列表项
    1. 行内公式: E=mc^2
    2. 行内代码: x = 1
    外层另一个列表项
  • 第二层菜单项
  • ", + "content": { + "items": [ + { + "c": "外层列表项" + }, + { + "child_list": { + "list_attribute": "ordered", + "items": [ + { + "c": "行内公式: $E=mc^2$" + }, + { + "c": "行内代码: `x = 1`" + } + ] + } + }, + { + "c": "外层另一个列表项" + }, + { + "child_list": { + "list_attribute": "unordered", + "items": [ + { + "c": "第二层菜单项" + } + ] + } + } + ], + "list_attribute": "definition", + "list_nest_level": "2" + } } ``` -| 字段 | 类型 | 描述 | 是否必须 | -| ----------------------- | ------ | --------------------------------------------------- | -------- | -| type | string | 值固定为list | 是 | -| raw_content | string | 原始文本内容 | 可选 | -| content.items | array | 列表项,每个元素是N个段落,段落里的元素是文本或公式 | 是 | -| content.list_attribute | string | unordered/ordered/definition | 可选 | -| content.list_nest_level | int | list的嵌套层级(单层list list_nest_level为1) | 可选 | +| 字段 | 类型 | 描述 | 是否必须 | +| ----------------------- | ------ | --------------------------------------------------------- | -------- | +| type | string | 值固定为list | 是 | +| raw_content | string | 原始文本内容 | 可选 | +| content.items | array | 列表项,每个元素是N个段落,段落里的元素是文本、公式或代码 | 是 | +| content.list_attribute | string | unordered/ordered/definition | 可选 | +| content.list_nest_level | int | list的嵌套层级(单层list list_nest_level为1) | 可选 | items字段说明 @@ -318,12 +346,12 @@ ```json { - "type": "title", - "raw_content": null, - "content": { - "title_content": "大模型好,大模型棒", - "level": 1 // 标题级别,1-N, 1最大 - } + "type": "title", + "raw_content": "

    大模型好,大模型棒1

    ", + "content": { + "title_content": "大模型好,大模型棒1", + "level": "1" + } } ``` @@ -338,13 +366,22 @@ ```json { - "type": "paragraph", - "raw_content": null, - "content": [ - {"c": "爱因斯坦的质量方差公式是", "t": "text"}, - {"c": "E=mc^2", "t": "equation-inline"}, - {"c": ",其中E是能量,m是质量,c是光速 ","t": "text"} - ] + "type": "paragraph", + "raw_content": "Who Is In Your Top 3 Mentalists Of All Time? <code>x = 1</code> <ccmath-inline type=\"latex\" by=\"mathjax_mock\" html=\"$E=mc^2$\">E=mc^2</ccmath-inline> • MAGICIANSANDMAGIC.COM", + "content": [ + { + "c": "Who Is In Your Top 3 Mentalists Of All Time? x = 1", + "t": "text" + }, + { + "c": "E=mc^2", + "t": "equation-inline" + }, + { + "c": "• MAGICIANSANDMAGIC.COM", + "t": "text" + } + ] } ```