Seamlessly publish Markdown content to Feishu Docs with automatic formatting.
Seamlessly publish Markdown content to Feishu Docs with automatic formatting.
🎯 Problems Solved
| Problem | Solution | Problem | Solution |
|---|---|---|---|
| Markdown tables not rendering | Auto-convert tables to formatted lists | Markdown tables cannot render | Automatically convert to formatted lists |
| Permission management complexity | One-click collaborator management | Complex permission management | One-click collaborator management |
| 400 errors on long content | Auto-split long documents | 400 error with long content | Automatic chunked writing |
| Inconsistent formatting | write/append auto-render Markdown |
Inconsistent formatting | write/append automatic rendering |
| Block-level updates lose formatting | Clear distinction between write vs update | Block-level updates lose formatting | Distinguish between write vs update |
✨ Key Features
1. 📝 Smart Markdown Publishing
- Auto-render:
write/appendactions automatically render Markdown to Feishu structured docs - Table handling: Tables auto-converted to formatted lists (Feishu limitation workaround)
- Syntax support: Headers, lists, bold, italic, code, quotes, dividers
Automatic rendering:write/append The operation automatically renders Markdown as Feishu structured documents
Table handling: Tables are automatically converted to formatted lists (Feishu limitation solution)
Syntax support: Headings, lists, bold, italic, code, quotes, dividers
2. 🔐 Permission Management
- Add/remove collaborators
- Update permission levels (view/edit/full_access)
- List current permissions
- Transfer document ownership
Add/remove collaborators, update permission levels, list existing permissions, transfer document ownership
3. 📄 Document Operations
- Create new documents
- Write full content with Markdown
- Append to existing documents
- Update specific blocks (plain text only)
- Delete blocks
- List document structure
Create new documents, write complete Markdown content, append content, update specified blocks, delete blocks, list document structure
🚀 Quick Start
Installation
cd ~/.openclaw/workspace/skills
git clone https://github.com/Shuai-DaiDai/feishu-doc-manager.git
Usage Examples
Create Document
{
"action": "create",
"title": "Project Report | 项目报告",
"folder_token": "optional_folder_token"
}
Write Markdown Content
⚠️ Critical: Use write for Markdown rendering, NOT update_block
⚠️ Critical: Use write for Markdown rendering, not update_block
{
"action": "write",
"doc_token": "UWpxdSnmXo6mPdxwOyCcWTPUndD",
"content": "# Project Overview | 项目概览\n\n## Key Metrics | 关键指标\n\n- **Revenue | 收入**: $100K\n- **Users | 用户**: 10K\n- **Growth | 增长**: 25%\n\n> Important note | 重要提示\n> This is a blockquote | 这是引用块"
}
Add Collaborator
curl -X POST "https://open.feishu.cn/open-apis/drive/v1/permissions/{doc_token}/members?type=docx" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"member_type": "openid",
"member_id": "ou_xxx",
"perm": "edit"
}'
📋 Supported Markdown
| Markdown | Feishu Result | Markdown | Feishu effect |
|---|---|---|---|
# Title |
Heading 1 | # 标题 |
Heading 1 |
## Title |
Heading 2 | ## 标题 |
Heading 2 |
### Title |
Heading 3 | ### 标题 |
Heading 3 |
- Item |
Bullet list | - 项目 |
Unordered list |
1. Item |
Numbered list | 1. 项目 |
Ordered list |
**bold** |
Bold | **粗体** |
Bold |
*italic* |
Italic | *斜体* |
Italic |
`code` |
Inline code | `代码` |
Inline code |
> quote |
Blockquote | > 引用 |
Quote block |
--- |
Divider | --- |
Divider |
⚠️ Not Supported
- Tables: Convert to lists
- Images: Use separate upload
- Complex HTML: Use Markdown
🔧 Important Distinctions
write/append vs update_block
| Feature | write/append |
update_block |
|---|---|---|
| Markdown rendering | ✅ Yes | ❌ No (plain text only) |
| Use case | Initial content, additions | Quick text updates |
| Formatting | Full Markdown support | Plain text only |
| Feature | Initial content, append | Quick text updates |
| Formatting support | Full Markdown | Plain text only |
Best Practice: Always use write or append for Markdown content.
Best practice: Always use write or append。
🐛 Troubleshooting
400 Bad Request
Cause: Content too long Solution: Split into smaller chunks
Markdown Not Rendering
Cause: Used update_block instead of write | Cause: used update_block instead of write
Solution: Use write or append for Markdown | Solution: Use write or append
Permission Denied
Cause: Missing docs:permission.member scope | Cause: Missing docs:permission.member permission
Solution: Add permission in Feishu app console
📦 Required Permissions
{
"scopes": {
"tenant": [
"docx:document",
"docx:document:create",
"docx:document:write_only",
"docs:permission.member",
"contact:user.base:readonly"
]
}
}
📝 License
MIT