Files
marqdo/ext/web/dom/index.mq.md
T

2.7 KiB

markup, title, description, import
markup title description import
occlusion ext/web/dom DOM Artifact — Markdown/body to structure; raw HTML is escape hatch only (ADR 0007). Never use raw as the default homepage method.
cap table
ext/web/_capability/index.mq.md lib/table.mq.md

DOM helpers separate Markdown content from HTML rendering. Prefer component.markdown for layout leaves. from_markdown and raw only construct data and need no plugin; render needs --effects plugin.

marqdo call ext/web/dom/index.mq.md from_markdown 'text="# Readable"' --session handbook --toget body --json
marqdo call ext/web/dom/index.mq.md render 'dom=$body' --effects plugin --session handbook --json

raw remains an explicit compatibility escape hatch, not a homepage layout method. Add content behavior through Markdown/render and preserve the existing raw path; do not use raw to compensate for missing decomposition.

from_markdown

参数 类型 说明
text text Markdown source

Turn Markdown text into a simple DOM map {kind:"markdown", text} for page.render / web.render. This is the default body path for Document prose.

返回 类型 说明
result any DOM map

out = > table.put in=None at="kind" value="markdown" > table.put in=out at="text" value=text

raw

参数 类型 说明
html text raw HTML (escape hatch)

Escape hatch — wrap raw html. Prefer Markdown / View nodes. Allowed only when table-driven layout cannot express a host constraint; document the why next to the call. Forbidden as the primary implementation of nav/sidebar/footer/home.

返回 类型 说明
result any DOM map kind=raw

out = > table.put in=None at="kind" value="raw" > table.put in=out at="html" value=html

render

参数 类型 说明
dom any DOM map from from_markdown or raw

Render DOM Artifact dom (from from_markdown or raw) to HTML via the native plugin. When kind is markdown, the plugin turns Markdown text into HTML for Document preview. When kind is raw, the stored HTML string is returned unchanged — that path exists only for the escape hatch documented on raw, not for assembling a full site shell. Prefer feeding markdown DOM produced by from_markdown, or skip this helper and use page.render / web.render on View tables from file-partitioned components.

返回 类型 说明
result any HTML text

cap.load kind = kind)

  1. kind == "raw" html = html) html

text = text) > web_dom_markdown text=text