Skip to content

Latest commit

 

History

History
97 lines (66 loc) · 2.63 KB

File metadata and controls

97 lines (66 loc) · 2.63 KB

publish-all

One Markdown file → publish to your blog + generate platform-ready content for WeChat, Zhihu, Xiaohongshu, and more.

A Claude Code skill for content distribution across Chinese social media platforms.

Why

You write a blog post in Markdown. Now you need it on WeChat, Zhihu, Xiaohongshu, and your blog. Each platform wants a different format. You spend 30 minutes reformatting.

publish-all does this in one command:

bash scripts/publish-all.sh my-post.md

Output:

~/Desktop/publish-my-post/
├── 微信订阅号-my-post.docx    # Word doc with embedded QR codes
├── 知乎-my-post.md            # Clean markdown, no QR images
├── 小红书-my-post.txt          # Short text + emojis + hashtags
└── 原文-my-post.md             # Archive

Install as Claude Code Skill

# Clone
git clone https://github.com/iPythoning/publish-all.git

# Symlink to Claude Code skills
ln -s $(pwd)/publish-all ~/.claude/skills/publish-all

Then in Claude Code:

/publish-all ~/Desktop/my-article.md
/publish-all ~/Desktop/my-article.md --slug custom-slug

Optional: Auto-publish to blog

Create ~/.publish-all.env:

# Option A: SSH + PostgreSQL (direct DB insert)
BLOG_SSH_HOST=user@your-server.com
BLOG_SSH_PASS=your-password
BLOG_DB_USER=dbuser
BLOG_DB_NAME=dbname
BLOG_AUTHOR_ID=auto

# Option B: REST API
BLOG_API_URL=https://yourblog.com/api/blog/publish
BLOG_API_KEY=your-api-key

Without this file, blog publishing is skipped — you still get all the format conversions.

How the format conversion works

Platform Input Transform Output
WeChat Markdown Parse headings, bold, lists, blockquotes → python-docx elements; download QR codes as inline images .docx
Zhihu Markdown Strip QR images, convert image links to text links, add source attribution .md
Xiaohongshu Markdown Extract key points, rewrite as short-form with emojis, add hashtags .txt

Extending

Add a new platform in scripts/gen-formats.py:

def generate_weibo(md: str) -> str:
    # Your conversion logic
    return weibo_text

Register it in main(), done.

Requirements

  • Python 3.10+
  • sshpass (only if using SSH blog publishing)
  • First run auto-creates a Python venv with python-docx, Pillow, requests

License

MIT

Credits

Built by PulseAgent — AI-powered B2B sales automation.

If you find this useful, check out our B2B SDR Agent template (open source, one-liner deploy).