Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.inplain.app/llms.txt

Use this file to discover all available pages before exploring further.

把任意 Plain source 渲染成完整 HTML。同 pipeline 给工作台预览 / 演讲模式 / 分享页用。

Request

POST /api/render
Content-Type: application/json

{
  "kind": "deck",
  "source": "---\nmarp: true\n...",
  "workspace": [],
  "themeOverride": "plain-mono",
  "customTokens": null,
  "animate": true,
  "readOnly": true
}
Field含义
kind”deck” | “doc” | “sheet”
source完整源码
workspace跨文档 @ref 解析上下文
themeOverride强制主题(忽略 frontmatter)
customTokensdirection-picker 用的临时 ThemeTokens
animate是否注入入场动画
readOnlytrue = 不注入 visual-edit 交互脚本

Response

Content-Type: text/html — 完整 HTML 文档(自包含 CSS/JS,可直接 iframe srcdoc)。

用例

const res = await fetch('https://inplain.app/api/render', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ kind: 'deck', source, readOnly: true }),
});
const html = await res.text();
iframe.srcdoc = html;
公开端点,不需要 auth。这是为什么 /showcase 能给所有人渲染 demo, 也是为什么 trq212 思路的”自包含 .html 文件”在 Plain 里更轻 —— 你不需要导出 HTML 文件,直接 POST source 拿 HTML。