Skip to content
md-to-feishu logo

Markdown to Feishu Document

md-to-feishu

Convert local Markdown files to Feishu (Lark) documents with automatic image uploading. Uses the feishu-docx CLI tool.

SKILL.md

Full skill instructions

Markdown to Feishu Document

Convert a local Markdown file into a Feishu document, with automatic image upload.

User Input

The user only needs to provide a Markdown file path. Title is optional — if not provided, extract it automatically (see below).

Step 1: Determine the Document Title

  1. Read the Markdown file and look for the first # heading — use that as the title.
  2. If no # heading exists, scan the content and generate a concise, descriptive title based on the topic.
  3. If the user explicitly provides a title, use that instead.

Step 2: Check the Runtime Environment

Try each option in order. Use the first one that works.

Option A: uvx (preferred)

which uvx

If uvx is available, the run command is:

uvx feishu-docx create "<TITLE>" -f <MARKDOWN_FILE_PATH>

If uvx runs with Python < 3.11, add --python 3.11:

uvx --python 3.11 feishu-docx create "<TITLE>" -f <MARKDOWN_FILE_PATH>

Option B: feishu-docx already installed

which feishu-docx

If found, check Python version:

python3 --version

If Python >= 3.11, the run command is:

feishu-docx create "<TITLE>" -f <MARKDOWN_FILE_PATH>

Option C: Nothing available — install guidance

If neither uvx nor feishu-docx is found, tell the user:

feishu-docx requires Python >= 3.11. Install with one of:

# Recommended: install uv, then run directly without global install
curl -LsSf https://astral.sh/​uv/​install.sh | sh
uvx feishu-docx create "Title" -f file.md

# Or: install globally with pip (Python >= 3.11 required)
pip install feishu-docx

Feishu credentials must be configured first:

feishu-docx config set --app-id <APP_ID> --app-secret <APP_SECRET>

Then stop and wait for the user to set up the environment.

Step 3: Pre-process Mermaid Blocks

The feishu-docx tool cannot handle Mermaid code blocks. Before uploading, check if the Markdown contains any ```mermaid blocks and convert them to images first.

3a: Scan for Mermaid blocks

Read the Markdown file and check if it contains any ```mermaid fenced code blocks. If none are found, skip to Step 4.

3b: Create a temporary copy

Copy the original Markdown file to a temp file in the same directory (so relative image paths still work):

<original-name>.feishu-tmp.md

For example: blog_post.md → blog_post.feishu-tmp.md

All subsequent modifications happen on this temp copy. The original file is never modified.

3c: Render Mermaid diagrams to PNG

For each ```mermaid ... ``` block in the temp file, render it to a PNG image using the mermaid.ink API:

import base64, urllib.request

def render_mermaid(code: str, output_path: str):
    """Render a Mermaid diagram to PNG via mermaid.ink API."""
    encoded = base64.urlsafe_b64encode(code.encode()).decode()
    url = f"https://mermaid.ink/​img/​{encoded}?bgColor=white"
    req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/​5.0"})
    resp = urllib.request.urlopen(req, timeout=30)
    with open(output_path, "wb") as f:
        f.write(resp.read())

Important: The User-Agent header is required — mermaid.ink returns 403 without it.

Save rendered images to the same directory as the Markdown file, using descriptive filenames based on diagram content:

  • GOOD: mermaid-architecture-overview.png, mermaid-data-flow.png
  • BAD: mermaid-1.png, diagram.png

3d: Replace Mermaid blocks with image references

In the temp copy, replace each ```mermaid ... ``` block with a Markdown image reference:

![Architecture overview](mermaid-architecture-overview.png)

Use relative paths from the temp file to the rendered images.

3e: Use the temp file for upload

From this point, the temp file becomes the <MARKDOWN_FILE_PATH> used in Step 4.

Step 4: Run the Command

  • Run from the directory where the Markdown file lives (or where its relative image paths resolve correctly), so that local image references work.
  • The tool will:
    • Convert Markdown blocks to Feishu format
    • Automatically upload local images referenced in the Markdown
    • Wait ~10s for block consistency before uploading images

Step 5: Clean Up

If a temp file was created in Step 3:

  • Delete the temp Markdown file (*.feishu-tmp.md)
  • Delete all rendered Mermaid PNG files created in Step 3c (they were only needed for the upload)

Step 6: Report Result

Show the user:

  • Number of blocks converted and images uploaded
  • The created document ID
  • Success or failure status

If it fails with authentication errors, remind the user to configure credentials:

feishu-docx config set --app-id <APP_ID> --app-secret <APP_SECRET>

More Marketing & SEO skills

copywriting logo
Marketing & SEO

copywriting

Marketing copy for homepages, landing pages, pricing pages, and other conversion-focused web pages.

53.3K 216.1K
View
flux-2-klein logo
Marketing & SEO

flux-2-klein

Fast image generation with Flux 2 Klein, optimized for sub-second iteration and multi-reference brand styling.

52 176.2K
View
marketing-psychology logo
Marketing & SEO

marketing-psychology

Psychological principles and mental models for understanding customer behavior and influencing marketing decisions.

53.3K 153K
View
content-strategy logo
Marketing & SEO

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
programmatic-seo logo
Marketing & SEO

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View
marketing-ideas logo
Marketing & SEO

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
ai-seo logo
Marketing & SEO

ai-seo

Optimize content for discovery, citation, and visibility across AI search platforms and LLM assistants.

53.3K 136.7K
View
copy-editing logo
Marketing & SEO

copy-editing

Systematic improvement of existing marketing copy through seven focused editing passes.

53.3K 136.4K
View
site-architecture logo
Marketing & SEO

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View
revops logo
Marketing & SEO

revops

Design and optimize systems connecting marketing, sales, and customer success into a unified revenue engine.

53.3K 104.9K
View
brand-guidelines logo
Marketing & SEO

brand-guidelines

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View
website-to-hyperframes logo
Marketing & SEO

website-to-hyperframes

Convert websites into professional HyperFrames videos with guided storyboarding and brand-aligned composition.

57K 93.5K
View

Sales & marketing AI tools

KreadoAI logo
Sales & marketing

KreadoAI

Revolutionize Video Creation with AI-Generated Avatars and Voices

Paid
View
Followr logo
Sales & marketing

Followr

Social media on autopilot

Paid
View
Logodiffusion logo
Sales & marketing

Logodiffusion

Design custom logos instantly with AI.

Paid
View
I
Sales & marketing

Ideogram

Text-heavy marketing and design images

Freemium
View
Prompt Silo logo
Sales & marketing

Prompt Silo

Boost Your SEO with Content and SEO Silos

Free
View
Marketing Blocks logo
Sales & marketing

Marketing Blocks

Revolutionize Your Marketing with AI-Powered MarketingBlocks!

Paid
View
Scrip AI logo
Sales & marketing

Scrip AI

10X faster & free AI content creation for 100+ use cases

Free
View
Tribescaler logo
Sales & marketing

Tribescaler

Tribescaler | Make Your Tweets Go Viral

Paid
View