Skip to content
Back to skills

md-to-rednote

ASecurity

Convert Markdown articles into RedNote (小红书/Xiaohongshu) style image cards. Use when: generating social media images from markdown, creating rednote posts, converting blog posts to card-style images for rednote, xiaohongshu, 小红书, 图片卡片.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
content-marketingpythonbashgit

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add DjTaNg-404/md-to-rednote --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of md-to-rednote?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for md-to-rednote
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/djtang-404-md-to-rednote/badge)](https://www.skillsdirectory.com/skills/djtang-404-md-to-rednote)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: md-to-rednote
description: "Convert Markdown articles into RedNote (小红书/Xiaohongshu) style image cards. Use when: generating social media images from markdown, creating rednote posts, converting blog posts to card-style images for rednote, xiaohongshu, 小红书, 图片卡片."
argument-hint: "Provide the path to a Markdown file to convert"
---

# Markdown 转 RedNote(小红书)图片卡片

## 功能

将 Markdown 格式的文章自动拆分并渲染为多张 RedNote(小红书)风格的图片卡片(1080×1440),可直接用于发布。

支持特性:
- 基于像素高度的智能分页,内容密度均匀
- 标题保护机制(标题不会孤零零出现在页底)
- 手动分页标记 `<!-- pagebreak -->`
- 8 套配色主题
- 超过图片数量上限时自动缩小字号适配
- 任务列表(`- [x]`/`- [ ]`)渲染为复选框样式
- Emoji 完整支持
- 数学公式(LaTeX)支持

## 使用场景

- 将博客文章、学习笔记转为 RedNote 图文笔记
- 将技术文档转为易读的卡片式图片
- 批量生成统一风格的社交媒体内容图

## 使用方法

```bash
python .github/skills/md-to-rednote/scripts/convert.py <markdown_file> [--output <dir>] [--theme <name>] [--max-images <n>]
```

参数说明:
- `markdown_file`:输入的 Markdown 文件路径
- `--output, -o`:输出目录(默认:markdown 文件同目录下的 `<文件名>_cards/`)
- `--theme, -t`:配色主题(默认:warm)
- `--max-images, -m`:最大图片数量,超过会自动缩小字号(默认:18)

### 可选主题

- `warm` — 暖橙色调(默认)
- `cool` — 冷蓝色调
- `green` — 清新绿色调
- `dark` — 暗色主题
- `xiaohongshu` — RedNote 经典粉红
- `zhihu` — 知乎蓝
- `notion` — Notion 简约风
- `douyin` — 抖音暗色

## 依赖

- Python 3.10+
- markdown-it-py
- jinja2
- playwright(需安装 Chromium:`playwright install chromium`)

## 参考资源

- [转换脚本](./scripts/convert.py)
- [封面模板](./assets/templates/cover.html)
- [正文模板](./assets/templates/content.html)

Files in this skill

  • SKILL.md2.1 KB
  • examples/demo.md1.3 KB
  • requirements.txt55 B
  • scripts/convert.py18.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.