Refactor executable library handbooks and improve document reading

This commit is contained in:
cflmy committed 2026-11-08 22:19:11 +08:00
1 parent 16c44588d5
commit c50c515c4a
191 files changed
+29572 -7816

No files matched your search

+46 -37
View File
@@ -24,71 +24,80 @@ browser bridge tests and matching Chinese entry points.
## embed
| 参数 | 类型 | 说明 |
|------|------|------|
| bridge | text | bridge script URL |
| wasm | text | wasm URL |
| source | text | optional source URL |
| boot | bool | auto boot |
HTML snippet that loads the official browser Marqdo bridge (route C/D). Defaults:
`bridge`="/static/marqdo-bridge.js", `wasm`="/static/marqdo_wasm.wasm",
`source`="", `boot`=True . With boot and non-empty source, auto-mounts. No author
JS. Not a substitute for file-partitioned Document layout.
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| bridge | text | "/static/marqdo-bridge.js" | bridge script URL |
| wasm | text | "/static/marqdo_wasm.wasm" | wasm URL |
| source | text | "" | optional source URL |
| boot | bool | True | auto boot |
| 返回 | 类型 | 说明 |
|------|------|------|
| result | text | HTML script tag |
Use `bridge`="/static/marqdo-bridge.js", `wasm`="/static/marqdo_wasm.wasm", `source`="", `boot`=True as the inputs for this operation.
HTML snippet that loads the official browser Marqdo bridge (route C/D). Defaults:
`bridge`="/static/marqdo-bridge.js", `wasm`="/static/marqdo_wasm.wasm",
`source`="", `boot`=True . With boot and non-empty source, auto-mounts. No author
JS. Not a substitute for file-partitioned Document layout.
1. `boot`
1. `source` != ""
*"<script type=\"module\" src=\"" + bridge + "\" data-mq-wasm=\"" + wasm + "\" data-mq-source-url=\"" + source + "\"></script>"*
Return *"<script type=\"module\" src=\"" + bridge + "\" data-mq-wasm=\"" + wasm + "\" data-mq-source-url=\"" + source + "\"></script>"*.
2. *
*"<script type=\"module\" src=\"" + bridge + "\"></script>"*
Return *"<script type=\"module\" src=\"" + bridge + "\"></script>"*.
2. *
*"<script type=\"module\" src=\"" + bridge + "\" data-mq-no-boot=\"1\"></script>"*
Return *"<script type=\"module\" src=\"" + bridge + "\" data-mq-no-boot=\"1\"></script>"*.
## text_patch
| 参数 | 类型 | 说明 |
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| sel | text | required | CSS selector |
| text | text | required | text content |
| 返回 | 类型 | 说明 |
|------|------|------|
| sel | text | CSS selector |
| text | text | text content |
| result | any | effects map |
Use `sel`, `text` as the inputs for this operation.
Build a `set_text` effects map for selector `sel` with string `text`. Prefer
lib/browser in client .mq.md programs; this helper is for call-side sketches.
| 返回 | 类型 | 说明 |
|------|------|------|
| result | any | effects map |
**`m` = > table.put in=None at=sel value=text**
*> table.put in=None at="set_text" value=m*
We retain **`m` = [Return the updated structured value](table.put(in=None, at=`sel`, value=`text`))**.
Return *[Set the set_text field in the new record](table.put(in=None, at="set_text", value=`m`))*.
## dom_patch
| 参数 | 类型 | 说明 |
|------|------|------|
| sel | text | CSS selector |
| html | text | optional HTML |
| attrs | any | optional attrs map |
| remove | bool | remove node |
Build a `dom` effects map for selector `sel`. Optional `html`="", `attrs`=None,
`remove`=False . Prefer View/Markdown over raw html patches for page shells.
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| sel | text | required | CSS selector |
| html | text | "" | optional HTML |
| attrs | any | None | optional attrs map |
| remove | bool | False | remove node |
| 返回 | 类型 | 说明 |
|------|------|------|
| result | any | effects map |
**`spec` = > table.put in=None at="html" value=html**
Use `sel`, `html`="", `attrs`=None, `remove`=False as the inputs for this operation.
Build a `dom` effects map for selector `sel`. Optional `html`="", `attrs`=None,
`remove`=False . Prefer View/Markdown over raw html patches for page shells.
We retain **`spec` = [Set the html field in the new record](table.put(in=None, at="html", value=`html`))**.
1. `attrs`
**`spec` = > table.put in=`spec` at="attrs" value=attrs**
We retain **`spec` = [Set the attrs field in the new record](table.put(in=`spec`, at="attrs", value=`attrs`))**.
2. *
**_ = 1**
1. `remove`
**`spec` = > table.put in=`spec` at="remove" value=True**
We retain **`spec` = [Set the remove field in the new record](table.put(in=`spec`, at="remove", value=True))**.
2. *
**_ = 1**
**`m` = > table.put in=None at=sel value=spec**
*> table.put in=None at="dom" value=m*
We retain **`m` = [Return the updated structured value](table.put(in=None, at=`sel`, value=`spec`))**.
Return *[Set the dom field in the new record](table.put(in=None, at="dom", value=`m`))*.