Markdown to Share Cards
Turn raw notes, articles, or Markdown into a polished, offline-ready HTML card studio using render_cards.py (Python 3.8+ standard library only).
Workflow
Step 1: Clarify Platform, Theme & Density
Identify or infer from the user's request:
- Aspect Ratio:
3:4(小红书 / 朋友圈竖图, default),1:1(方形),16:9(横屏 / 封面), orlong(长图). - Theme (17 built-in themes):
- Classic:
editorial(极简杂志风, default),paper(暖色手账风),obsidian(暗黑极客风),matcha(清新抹茶风),swiss(瑞士海报风) - Modern UI & Layout:
glassmorphism(玻璃拟态),bento(便当盒布局),neumorphism(新拟态),split(分屏构成风) - Expressive & Editorial:
brutalism(粗野主义),neobrutalism(新粗野主义),y2k(Y2K千禧未来主义),collage(拼贴风),handdrawn(手绘插画风),memphis(孟菲斯风),monochrome-photo(黑白摄影排版风),botanical(自然生态风)
- Classic:
If the user provides a long article or rough notes, read design-guide.md before writing the card Markdown so every slide has balanced whitespace and zero overflow.
Step 2: Structure Content into Card Markdown
Create or refine a .md file with:
- YAML frontmatter (
title,subtitle,author,tag,theme,ratio,footer) - Standalone
---lines separating cards - Rich Markdown elements (
##headings, concise lists,==highlight==,> [!TIP]/> [!NOTE]/> [!WARN], code blocks, tables) - Optional card directives (
<!-- type: quote -->,<!-- type: ending -->) for visual rhythm
See sample-post.md for a complete reference layout.
Step 3: Render the HTML Card Studio
Run the zero-dependency renderer:
python scripts/render_cards.py "<input.md>" -o "<output.html>" --theme editorial --ratio 3:4
Step 4: Verify & Guide the User
Confirm <output.html> was generated and report the card count, theme, and ratio. Let the user know they can open <output.html> directly in any browser to:
- Switch between all 17 themes and 4 ratios live in the top toolbar (including quick
← 上一套/下一套 →cycling) - Toggle 网格预览 / 单张聚焦 (with keyboard
←/→) - Click 导出 PNG (single card) or 全部导出 PNG for 3× HiDPI images, or 打印 / 导出 PDF