← 返回
内容创作 中文

Feishu Md2blocks

Insert rich Markdown content (including tables) into Feishu documents. Use when feishu_doc write/append fails with tables, or when inserting complex formatte...
将富文本 Markdown 内容(包括表格)插入到飞书文档中。适用于 feishu_doc 的 write/append 在处理表格时失败,或需要插入复杂格式时使用。
deadblue22
内容创作 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 555
下载
💾 14
安装
1
版本
#latest

概述

Feishu Markdown to Blocks

Insert Markdown content—including tables—into Feishu documents via the block convert + descendant API.

When to Use

  • feishu_doc write replaces the entire document; use this to insert content at a position
  • feishu_doc create_table_with_values has limitations for larger tables
  • You need to insert tables, code blocks, or complex nested content into an existing doc

Usage

# Insert from file (appends to document end)
python3 <skill_dir>/scripts/md2blocks.py <doc_token> content.md

# Insert from stdin
echo "| A | B |\n|---|---|\n| 1 | 2 |" | python3 <skill_dir>/scripts/md2blocks.py <doc_token> -

# Insert after a specific block
python3 <skill_dir>/scripts/md2blocks.py <doc_token> content.md --after <block_id>

# Replace all content
python3 <skill_dir>/scripts/md2blocks.py <doc_token> content.md --replace

How It Works

  1. Calls POST /docx/v1/documents/blocks/convert to convert Markdown → block structures
  2. Removes merge_info from table blocks (read-only field that causes insertion errors)
  3. Calls POST /docx/v1/documents/{doc}/blocks/{parent}/descendant to insert blocks

The descendant API handles nested structures (tables with cells containing text) that the simpler /children API cannot.

Position Control

The --after option inserts content right after the specified block. The script finds the block's index automatically.

Key detail: The /descendant API's index parameter must be in the request body, not as a URL query parameter. Passing ?index=N in the URL is silently ignored (content appends to end). The script handles this correctly.

Supported Markdown

Text, headings (h1-h9), bullet lists, ordered lists, code blocks, quotes, tables, todo items, dividers.

Limitations

  • Images in Markdown are not automatically uploaded; they require separate upload + patch steps
  • Max 1000 blocks per insert call; split large documents if needed
  • Requires docx:document.block:convert permission on the Feishu app
  • Document edit rate limit: 3 ops/sec per document

Reference

For complete block-level API reference, see the feishu-block-ops skill which covers:

  • All block APIs (create/read/update/delete/batch)
  • Block type reference, text element types
  • Table operation patterns (batch edit, merge cells)
  • Common patterns and gotchas

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 12:13 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 857 📥 199,255
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 294 📥 136,401
communication-collaboration

Feishu Message Reader

deadblue22
根据 message_id 获取飞书消息内容,支持可选的话题上下文。激活条件:需要通过消息 ID 读取特定飞书消息内容时。
★ 0 📥 1,265