输入 Markdown
加入需要分析的文档或最小复现片段。
把 Markdown 解析成带类型、层级和内容的 JSON 抽象语法树,而不是把整篇文字简单塞进一个 JSON 字段。
[
{
"type": "heading",
"children": [
{
"type": "inline",
"content": "项目笔记",
"children": [
{
"type": "text",
"content": "项目笔记"
}
]
}
],
"tag": "h1"
},
{
"type": "paragraph",
"children": [
{
"type": "inline",
"content": "清晰的文档从**明确的结构**开始。",
"children": [
{
"type": "text",
"content": "清晰的文档从"
},
{
"type": "strong_open",
"tag": "strong"
},
{
"type": "text",
"content": "明确的结构"
},
{
"type": "strong_close",
"tag": "strong"
},
{
"type": "text",
"content": "开始。"
}
]
}
],
"tag": "p"
},
{
"type": "heading",
"children": [
{
"type": "inline",
"content": "检查重点",
"children": [
{
"type": "text",
"content": "检查重点"
}
]
}
],
"tag": "h2"
},
{
"type": "bullet_list",
"children": [
{
"type": "list_item",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "inline",
"content": "层级清楚的标题",
"children": [
{
"type": "text",
"content": "层级清楚的标题"
}
]
}
],
"tag": "p"
}
],
"tag": "li"
},
{
"type": "list_item",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "inline",
"content": "可以正常打开的链接",
"children": [
{
"type": "text",
"content": "可以正常打开的链接"
}
]
}
],
"tag": "p"
}
],
"tag": "li"
},
{
"type": "list_item",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "inline",
"content": "便于继续编辑的文件",
"children": [
{
"type": "text",
"content": "便于继续编辑的文件"
}
]
}
],
"tag": "p"
}
],
"tag": "li"
}
],
"tag": "ul"
},
{
"type": "blockquote",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "inline",
"content": "下载前先检查渲染预览。",
"children": [
{
"type": "text",
"content": "下载前先检查渲染预览。"
}
]
}
],
"tag": "p"
}
],
"tag": "blockquote"
}
]
输入变化后,JSON 节点结构会随之更新。
加入需要分析的文档或最小复现片段。
展开标题、段落、列表、链接、代码等节点,确认父子关系。
将 AST 用于调试、转换管线或自定义渲染。
AST 让程序能够按结构处理文档。
定位某段语法为什么没有按预期渲染。
从 AST 生成内部数据结构、索引或其他标记语言。
比较两个文档的节点变化,而不只看原始字符 diff。
更准确地说是解析后的 AST,JSON 用来表示文档节点、属性和层级。
AST 保留语义结构,但空白、标记选择等源代码细节可能不会逐字符还原。
可以作为开发管线的一部分,但正式接口应固定并记录 schema,而不是依赖页面内部实现长期不变。