将 Markdown 文章/文本转换为针对平台优化的社交媒体帖子。
一次创作 → 多种格式(Twitter 主题帖、LinkedIn 帖子、Reddit 帖子)。
python3 scripts/md2social.py convert <文件.md> --platform twitter|linkedin|reddit
python3 scripts/md2social.py convert <文件.md> --all
python3 scripts/md2social.py convert --text "直接输入的文本" --platform twitter
| 选项 | 描述 |
|---|---|
--platform |
指定平台:twitter、linkedin 或 reddit |
--all |
一次性生成全部 3 种格式 |
--text |
使用直接输入的文本,而非文件 |
--output DIR |
保存到文件(twitter.txt, linkedin.txt, reddit.md) |
--json |
以 JSON 格式输出 |
仅需 Python 3.10+ 标准库。无需外部包,无需 API 调用。
# 从文章生成 Twitter 主题帖
python3 scripts/md2social.py convert article.md --platform twitter
# 生成所有平台格式并保存到文件
python3 scripts/md2social.py convert article.md --all --output ./social-posts
# 快速将文本转换为 LinkedIn 帖子
python3 scripts/md2social.py convert --text "今日重大新闻..." --platform linkedin
# 输出 JSON 格式以便自动化处理
python3 scripts/md2social.py convert article.md --all --json
skills/markdown-to-social/
├── SKILL.md # 本文档
└── scripts/
└── md2social.py # 主 CLI 脚本