Loading...
Loading...
飞书文档写入。Markdown 转 Block、创建文档块、处理并发。
npx skill4agent add alextangson/feishu_skills feishu-doc-writerhttps://open.feishu.cn/open-apis/docx/v1POST /documents/{document_id}/convert{
"content": "# 标题\n\n正文\n\n- 列表项",
"content_type": "markdown"
}| block_type | 名称 | JSON Key | 说明 |
|---|---|---|---|
| 1 | 页面 | | 文档根节点 |
| 2 | 文本 | | 段落 |
| 3-11 | 标题1-9 | | - |
| 12 | 无序列表 | | 每项单独一个 block |
| 13 | 有序列表 | | - |
| 14 | 代码块 | | 需指定 |
| 15 | 引用 | | - |
| 17 | 待办 | | 带 |
| 19 | 高亮块 | | 飞书特有,容器块 |
| 22 | 分割线 | | - |
| 27 | 图片 | | 两步:创建占位 + 上传 |
| 31 | 表格 | | - |
POST /documents/{document_id}/blocks/{block_id}/children?document_revision_id=-1{
"children": [...],
"index": 0
}block_iddocument_idindex{"block_type": 2, "text": {"elements": [{"text_run": {"content": "段落"}}]}}{"block_type": 3, "heading1": {"elements": [{"text_run": {"content": "标题"}}]}}{
"block_type": 14,
"code": {
"style": {"language": 1},
"elements": [{"text_run": {"content": "console.log('hello')"}}]
}
}{
"block_type": 19,
"callout": {
"background_color": 1,
"border_color": 1,
"emoji_id": "bulb"
},
"children": [
{"block_type": 2, "text": {"elements": [{"text_run": {"content": "提示内容"}}]}}
]
}{"block_type": 27, "image": {}}PUT /documents/{document_id}/blocks/{block_id}/image{
"text_run": {
"content": "样式文本",
"text_element_style": {
"bold": true,
"italic": true,
"strikethrough": true,
"underline": true,
"inline_code": true,
"background_color": 1,
"text_color": 1
}
}
}GET /documents/{document_id}?document_revision_id={revision}