create_document_from_html
Convert HTML/CSS pages into editable DingCard canvas documents, turning text, images, shapes, and SVG into movable nodes with CSS-based layout, styling, and layer order.
Instructions
把你写的 HTML/CSS 网页转成在叮卡里能逐个修改的自由画布文档(v44)。适合模板排不出来的版式:直接用网页写法排版,叮卡在浏览器里排好后,把每个色块、文字、图片和 SVG 图形读成形状、文字框、图片和图形节点,位置、字号、颜色、圆角、阴影、渐变等全部照网页来,层叠顺序按 CSS(含 z-index)。返回 documentId、每页 id 和尺寸、notes(哪里没转过来),默认附缩略图。之后 check_document 检查、apply_actions 修改、render_document 出图、open_in_editor 交给人。HTML 怎么写(section 分页、内置字体、图片、svg、表格、data-name)见 get_guide("html-import")。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | 网页源码(可以只写 <style> 和若干 <section>) | |
| width | No | 没写尺寸的页面的宽度,也是 100vw,默认 1080 | |
| height | No | 没写尺寸的页面的高度,也是 100vh,默认 1440 | |
| htmlPath | No | 网页文件路径,可替代 html;里面的相对路径按这个文件所在的目录找 | |
| previews | No | 是否附上缩略图,默认 true | |
| includeDocument | No | 同时返回完整文档 JSON(默认只返回 documentId 和 version) |