markdown-to-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInkframe — Markdown to Image
Inkframe — Markdown转图片
Inkframe renders markdown content into polished, styled images via the inkframe.dev API. Run it via — no global install needed. The package includes a free shared API key, so it works out of the box.
npx inkframeInkframe通过inkframe.dev API将markdown内容渲染为精美的带样式图片。你可以通过运行,无需全局安装。该包内置免费的共享API密钥,开箱即可使用。
npx inkframeSetup
安装配置
No setup needed — always run the CLI via . The package ships with a free shared API key, so it works out of the box with no signup.
npx inkframe无需任何配置——始终通过运行CLI即可。包自带免费共享API密钥,无需注册开箱即用。
npx inkframeQuick Start
快速开始
bash
undefinedbash
undefinedSimplest render — just give it markdown
最简单的渲染方式——直接传入markdown
npx inkframe render --content "# Hello World\n\nThis is styled." --output out.png
npx inkframe render --content "# Hello World\n\nThis is styled." --output out.png
Render from a file
从文件渲染
npx inkframe render --content @post.md --output out.png
npx inkframe render --content @post.md --output out.png
Use a template for instant styling
使用模板快速生成样式
npx inkframe render --template tmpl_PWfUUDlVw --content @post.md --output out.png
npx inkframe render --template tmpl_PWfUUDlVw --content @post.md --output out.png
Preview in the browser (free, no API key needed)
在浏览器中预览(免费,无需API密钥)
npx inkframe open --content @post.md --design @design.json
undefinednpx inkframe open --content @post.md --design @design.json
undefinedCLI Commands
CLI命令
npx inkframe open
npx inkframe opennpx inkframe open
npx inkframe openOpens the Inkframe playground in the browser with your content and design pre-loaded. Free, no API key needed — great for previewing and tweaking before rendering.
| Flag | Description | Default |
|---|---|---|
| Markdown string or | — |
| Inline JSON or | — |
| Playground base URL | |
bash
npx inkframe open --content "# Hello World"
npx inkframe open --content @post.md --design @design.json在浏览器中打开Inkframe playground,并预加载你的内容和设计。该功能免费,无需API密钥——非常适合在渲染前预览和调整样式。
| 标识 | 描述 | 默认值 |
|---|---|---|
| Markdown字符串或 | — |
| 内联JSON或 | — |
| Playground基础URL | |
bash
npx inkframe open --content "# Hello World"
npx inkframe open --content @post.md --design @design.jsonnpx inkframe render
npx inkframe rendernpx inkframe render
npx inkframe render| Flag | Description | Default |
|---|---|---|
| Markdown string or | Required (unless |
| Template ID — applies its design (and content if | — |
| Inline JSON or | — |
| Save image to file (e.g. | prints URL |
| Scale factor: 1, 2, or 3 | 2 |
| Output format: | |
Content uses the prefix convention: reads from , while is inline markdown.
@--content @notes.mdnotes.md--content "# Title"| 标识 | 描述 | 默认值 |
|---|---|---|
| Markdown字符串或 | 必填(除非 |
| 模板ID——应用模板的设计(如果省略 | — |
| 内联JSON或 | — |
| 保存图片到文件(例如 | 打印URL |
| 缩放比例:1、2或3 | 2 |
| 输出格式: | |
内容使用前缀约定:表示从读取内容,而则是内联markdown。
@--content @notes.mdnotes.md--content "# 标题"npx inkframe templates list
npx inkframe templates listnpx inkframe templates list
npx inkframe templates listLists all available templates with their IDs and names.
列出所有可用模板及其ID和名称。
npx inkframe templates get <id>
npx inkframe templates get <id>npx inkframe templates get <id>
npx inkframe templates get <id>Gets full template JSON. Add to get just the design object. Add to save to file.
--design-only-o file.json获取完整的模板JSON。添加仅获取设计对象。添加保存到文件。
--design-only-o file.jsonAvailable Templates
可用模板
| ID | Name | Good for |
|---|---|---|
| Tweet (Dark) | Dark-themed tweet screenshots |
| Poem | Poetry, literary quotes |
| Quote | Inspirational/pull quotes |
| Business Poster | Professional announcements |
| Tweet | Tweet-style cards |
| DeepSeek问答 | Q&A format (Chinese) |
| Meme - Drake | Drake meme format |
| Tweet (Bilingual) | Bilingual tweet cards |
| Story (Bilingual) | Bilingual story format |
| Quote Card (Classic) | Classic styled quotes |
| Flowchart | Process/flow diagrams |
| Quote Card | Modern quote cards |
| Tweet | Alternative tweet style |
| Testimonial | Customer testimonials |
| Code Snippet | Code with syntax highlighting |
| Carousel | Multi-slide carousel |
| Listicle | Numbered/bulleted lists |
Templates are designed to look good out of the box — their fonts, colors, backgrounds, and layouts are already curated to work well together. Resist the urge to override a template's design unless the user specifically asks for customization. A template used as-is will almost always look more polished than a hastily assembled custom design.
| ID | 名称 | 适用场景 |
|---|---|---|
| 推文(深色) | 深色主题推文截图 |
| 诗歌 | 诗歌、文学名言 |
| 名言 | 励志/引用名言 |
| 商业海报 | 专业公告 |
| 推文 | 推文风格卡片 |
| DeepSeek问答 | 问答格式(中文) |
| 梗图 - Drake | Drake梗图格式 |
| 推文(双语) | 双语推文卡片 |
| 故事(双语) | 双语故事格式 |
| 名言卡(经典款) | 经典风格名言 |
| 流程图 | 流程/流程图解 |
| 名言卡 | 现代风格名言卡 |
| 推文 | 替代款推文样式 |
| 推荐语 | 客户推荐证言 |
| 代码片段 | 带语法高亮的代码 |
| 轮播图 | 多页轮播内容 |
| 清单文 | 编号/项目符号列表 |
模板都是经过设计开箱即用的——它们的字体、颜色、背景和布局都经过精心搭配,效果很好。除非用户明确要求自定义,否则不要覆盖模板的设计。直接使用模板几乎总是比匆忙组装的自定义设计看起来更精致。
Choosing the right template
选择合适的模板
Match the content to the template's purpose. When in doubt, inspect the template first with to see its content structure and design — then model your markdown after the template's content format for best results.
inkframe templates get <id>- Quotes/sayings: (Quote Card Classic) for elegant serif look,
tmpl_qtYz45Xao(Quote) for casual,tmpl_PWfUUDlVw(Quote Card) for moderntmpl_pXED6toGN - Code: (Code Snippet) — dark theme, window controls, syntax highlighting
tmpl_hSlqk3U8h - Tweets/social: ,
tmpl_W46vhIVoJ(dark),tmpl_650IbCa8ktmpl_ciwTrec6U - Long-form content: (Business Poster),
tmpl_DAtOcPEQE(Listicle)tmpl_0fJUHUTWs - Testimonials:
tmpl_jKumMZX6E
根据内容匹配模板用途。如果不确定,先通过查看模板,了解它的内容结构和设计——然后按照模板的内容格式编写你的markdown以获得最佳效果。
inkframe templates get <id>- 名言/语录:(经典款名言卡)适合优雅的衬线字体风格,
tmpl_qtYz45Xao(名言)适合休闲风格,tmpl_PWfUUDlVw(名言卡)适合现代风格tmpl_pXED6toGN - 代码:(代码片段)——深色主题、窗口控制栏、语法高亮
tmpl_hSlqk3U8h - 推文/社交内容:、
tmpl_W46vhIVoJ(深色)、tmpl_650IbCa8ktmpl_ciwTrec6U - 长内容:(商业海报)、
tmpl_DAtOcPEQE(清单文)tmpl_0fJUHUTWs - 推荐证言:
tmpl_jKumMZX6E
Custom designs (when templates aren't enough)
自定义设计(模板无法满足需求时)
Only reach for when the user wants something specific that no template provides — a particular aspect ratio, custom branding, or a specific color scheme. In that case, the best approach is:
--design- Find the closest template:
npx inkframe templates get <id> --design-only --output design.json - Modify only the fields that need to change
- Render with:
npx inkframe render --content @post.md --design @design.json --output out.png
For the full reference of all design fields (dimensions, backgrounds, color palettes, fonts, and more), read in this skill's directory.
references/design-options.md只有当用户需要模板无法提供的特定效果时才使用——比如特定的宽高比、自定义品牌标识或者特定的配色方案。这种情况下,最佳做法是:
--design- 找到最接近的模板:
npx inkframe templates get <id> --design-only --output design.json - 仅修改需要变更的字段
- 渲染:
npx inkframe render --content @post.md --design @design.json --output out.png
要查看所有设计字段(尺寸、背景、调色板、字体等)的完整参考,请阅读该技能目录下的文件。
references/design-options.mdMulti-Page Content
多页内容
Content can include to separate pages (e.g. for carousels or slideshows). The API renders one image per request — if your content has , only the first page is rendered. The inkframe.dev studio UI supports rendering all pages at once.
\pagebreak\pagebreakTo render multi-page content, split it yourself and make one render call per page. Run them in parallel for speed:
bash
undefined内容中可以包含来分隔页面(例如用于轮播图或幻灯片)。API每次请求渲染一张图片——如果你的内容有,只会渲染第一页。inkframe.dev studio UI支持一次性渲染所有页面。
\pagebreak\pagebreak要渲染多页内容,请自行拆分内容,每页调用一次渲染接口。可以并行运行以提升速度:
bash
undefinedSplit content and render each page in parallel
拆分内容并并行渲染每页
npx inkframe render --content @page1.md --design @design.json --output slide1.png &
npx inkframe render --content @page2.md --design @design.json --output slide2.png &
npx inkframe render --content @page3.md --design @design.json --output slide3.png &
wait
When building carousels or slideshows, write each page to a separate temp file, then render all pages in parallel using `&` and `wait`.npx inkframe render --content @page1.md --design @design.json --output slide1.png &
npx inkframe render --content @page2.md --design @design.json --output slide2.png &
npx inkframe render --content @page3.md --design @design.json --output slide3.png &
wait
制作轮播图或幻灯片时,将每页内容写入单独的临时文件,然后使用`&`和`wait`并行渲染所有页面。Design Pitfalls
设计注意事项
When is false, text renders directly on the background with no box behind it. Avoid these combinations — the text becomes unreadable:
contentBoxVisibility- Dark + light
backgroundKey(which has dark text) +colorPaletteKeycontentBoxVisibility: false - Light + dark
backgroundKey(which has light text) +colorPaletteKeycontentBoxVisibility: false
Either keep the content box visible, or match the palette theme to the background.
当为false时,文本会直接渲染在背景上,后面没有内容框。请避免以下组合——会导致文本无法阅读:
contentBoxVisibility- 深色+ 浅色
backgroundKey(包含深色文本) +colorPaletteKeycontentBoxVisibility: false - 浅色+ 深色
backgroundKey(包含浅色文本) +colorPaletteKeycontentBoxVisibility: false
要么保持内容框可见,要么让调色板主题和背景匹配。
Workflow Tips
工作流技巧
- Try a template as-is first — the curated designs are almost always better than custom ones. Use to browse, then render with
npx inkframe templates list.--template - Inspect before customizing — shows the template's content and design. Model your markdown after the template's content structure.
npx inkframe templates get <id> - Customize sparingly — if you must customize, start from a template's design and change only what's needed. Don't build designs from scratch.
- Preview with — use
npx inkframe opento open the playground in the browser for interactive previewing and tweaking. Free, no API key needed.npx inkframe open --content @post.md --design @design.json - Write markdown to a temp file for anything longer than a line or two, then use . This avoids shell escaping issues with inline content.
@file.md - Always use to save the image locally rather than just printing a URL.
--output - Content is standard markdown — headings, bold, italic, lists, code blocks, and blockquotes all render as expected.
- 先直接尝试使用模板——经过设计的模板几乎总是比自定义的效果更好。使用浏览模板,然后通过
npx inkframe templates list参数渲染。--template - 自定义前先查看模板——可以查看模板的内容和设计。按照模板的内容结构编写你的markdown。
npx inkframe templates get <id> - 尽量少自定义——如果必须自定义,从模板的设计开始,仅修改需要的部分。不要从零开始构建设计。
- 使用预览——使用
npx inkframe open在浏览器中打开playground进行交互式预览和调整。该功能免费,无需API密钥。npx inkframe open --content @post.md --design @design.json - 对于超过一两行的内容,将markdown写入临时文件,然后使用引用。这可以避免内联内容的shell转义问题。
@file.md - **始终使用**将图片保存到本地,而不仅仅是打印URL。
--output - 内容是标准markdown——标题、粗体、斜体、列表、代码块和块引用都可以正常渲染。