md-to-xhs-cards

Render Markdown content into Xiaohongshu-style image cards with a CLI.

16|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/erafat/skills --skill md-to-xhs-cards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: md-to-xhs-cards
Source: https://github.com/erafat/skills/tree/main/md-to-xhs-cards
Command: npx skills add https://github.com/erafat/skills --skill md-to-xhs-cards

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pillow, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Convert Markdown content into deterministic Xiaohongshu image cards with deterministic layout, preserving content order and local image references.

Core Features & Use Cases

  • Deterministic rendering of headings, paragraphs, lists, quotes, code blocks, and images in source order.
  • Local image support and Obsidian embeds, with fallback handling for missing assets.
  • Output artifacts include card images and a manifest, with optional publish-to-Xiaohongshu workflow.

Quick Start

Run the renderer on a Markdown file to generate 3:4 Xiaohongshu cards by executing scripts/run_md_to_xhs_cards.sh /path/to/post.md

Frequently Asked Questions about md-to-xhs-cards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to Xiaohongshu image cards?

To convert Markdown to Xiaohongshu image cards, run the renderer script on your Markdown file to generate 3:4 aspect ratio images. It deterministically renders headings, paragraphs, lists, quotes, code blocks, and images in their original source order.

Does the Markdown to Xiaohongshu rendering support local image references?

Yes, rendering local image references is fully supported, including Obsidian embeds. The renderer resolves local vault paths with fallback handling to ensure missing assets do not break the output image cards.

What is needed to generate Xiaohongshu cards from Markdown files?

You need Python and the Pillow dependency to execute the CLI workflow. A provided shell script runs the renderer on a specified Markdown file path to output the generated card images and a manifest.

Can I use Obsidian Markdown content to create Xiaohongshu image posts?

Yes, you can use Obsidian Markdown content to create Xiaohongshu image posts. The tool processes Obsidian embeds and local image paths, preserving the original content order across the generated image cards.

What is the best way to automate Xiaohongshu image card generation from Markdown?

The best way to automate Xiaohongshu image card generation is using this CLI workflow with Python and Pillow. It provides deterministic layout rendering and an optional publish-to-Xiaohongshu hook for automated publishing.