diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 8bcd2a9..4b94234 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -29,7 +29,7 @@ jobs: run: | cargo build --release # Skip import helpers (no `# main`); exclude both EN/ZH names. - find public -name '*.mq.md' ! -name 'utils.mq.md' ! -name '??.mq.md' -print0 \ + find public -name '*.mq.md' ! -name 'utils.mq.md' ! -name '工具.mq.md' -print0 \ | xargs -0 -n1 ./target/release/marqdo run ./target/release/marqdo view output public -o public diff --git a/public/00-welcome.mq.md b/public/00-welcome.mq.md index 1349beb..9b3466d 100644 --- a/public/00-welcome.mq.md +++ b/public/00-welcome.mq.md @@ -41,7 +41,7 @@ $$ Then plot it: -*`_svg` = > math.plot formula=`f` var=x min=-3 max=3 * +*`_svg` = > math.plot formula=`f` var="x" min=-3 max=3* The foreign library lets you call external code, for example: diff --git a/public/00-欢迎.mq.md b/public/00-欢迎.mq.md index 61957d6..14be2a3 100644 --- a/public/00-欢迎.mq.md +++ b/public/00-欢迎.mq.md @@ -41,7 +41,7 @@ $$ 之后让我们画个图像吧! -*`_svg` = > 数学.绘图 formula=`f` var=x min=-3 max=3 * +*`_svg` = > 数学.绘图 formula=`f` var="x" min=-3 max=3* 外联库则允许你调用外部代码,例如: diff --git a/public/features/06-quantum.mq.md b/public/features/06-quantum.mq.md index e84171f..a624573 100644 --- a/public/features/06-quantum.mq.md +++ b/public/features/06-quantum.mq.md @@ -18,11 +18,11 @@ GHZ (3 qubits): H on q0, then CX 0→1 and 0→2. Ideal |000⟩ / |111⟩ each | 2 | CX | 0,1 | | 3 | CX | 0,2 | -*`qc` = > quantum.circuit qubits=3 steps=`steps` * -*`p` = > `qc`.probabilities * -*`_` = > `qc`.draw kind=probs * -*`H` = > quantum.gate name=H * -*`__` = > `H`.draw kind=matrix * +*`qc` = > quantum.circuit qubits=3 steps=`steps`* +*`p` = > `qc`.probabilities* +*`_` = > `qc`.draw kind="probs"* +*`H` = > quantum.gate name="H"* +*`__` = > `H`.draw kind="matrix"* > print text=`p` > print text=quantum-feature-ok diff --git a/public/features/06-量子.mq.md b/public/features/06-量子.mq.md index a4f2bd1..d863612 100644 --- a/public/features/06-量子.mq.md +++ b/public/features/06-量子.mq.md @@ -18,11 +18,11 @@ GHZ(3 比特):q0 哈达玛,再控非 0→1、0→2。理想 |000⟩ / |1 | 2 | CX | 0,1 | | 3 | CX | 0,2 | -*`qc` = > 量子.电路 比特数=3 步骤=`步骤` * -*`p` = > `qc`.概率 * -*`_` = > `qc`.绘图 种类=probs * -*`H` = > 量子.门 名=H * -*`__` = > `H`.绘图 种类=matrix * +*`qc` = > 量子.电路 比特数=3 步骤=`步骤`* +*`p` = > `qc`.概率* +*`_` = > `qc`.绘图 种类="probs"* +*`H` = > 量子.门 名="H"* +*`__` = > `H`.绘图 种类="matrix"* > 打印 内容=`p` > 打印 内容=量子特性-ok diff --git a/public/keywords/input.mq.md b/public/keywords/input.mq.md index efcaa2b..e84359c 100644 --- a/public/keywords/input.mq.md +++ b/public/keywords/input.mq.md @@ -8,6 +8,6 @@ stdin: Ada The input builtin reads one line. For demos and marqdo view / static export, put sample lines in frontmatter (stdin:). CLI can also use a pipe or --stdin-file. Live view can override with the Preset input box. -*`name` = > input prompt=Name: * +*`name` = > input prompt="Name: "* > print text=Hello `name`! diff --git a/public/keywords/stdlib.mq.md b/public/keywords/stdlib.mq.md index e7fa99e..15ab006 100644 --- a/public/keywords/stdlib.mq.md +++ b/public/keywords/stdlib.mq.md @@ -19,13 +19,13 @@ Length and type: Trim, split, join, and index: -*`t` = > trim value= hi * +*`t` = > trim value=" hi "* -*`parts` = > split value=a,b sep=,* +*`parts` = > split value="a,b" sep=","* *`mid` = > at value=`parts` index=0* -*`j` = > join value=`parts` sep=-* +*`j` = > join value=`parts` sep="-"* > print text=`t` diff --git a/public/keywords/标准库.mq.md b/public/keywords/标准库.mq.md index 0d7e223..c9a6aa5 100644 --- a/public/keywords/标准库.mq.md +++ b/public/keywords/标准库.mq.md @@ -19,13 +19,13 @@ description: 主机内置;中文别名覆盖常用几个 去空白、拆分、拼接、按下标(主机名仍为英文): -*`t` = > trim value= 嗨 * +*`t` = > trim value=" 嗨 "* -*`parts` = > split value=甲,乙 sep=,* +*`parts` = > split value="甲,乙" sep=","* *`mid` = > at value=`parts` index=0* -*`j` = > join value=`parts` sep=-* +*`j` = > join value=`parts` sep="-"* > 打印 内容=`t` diff --git a/public/keywords/输入.mq.md b/public/keywords/输入.mq.md index bde7604..a36a80e 100644 --- a/public/keywords/输入.mq.md +++ b/public/keywords/输入.mq.md @@ -8,6 +8,6 @@ description: 从 stdin 读一行;可选提示。演示数据写在 frontmatter 内置「输入」读一行。演示与 marqdo view / 静态导出可在 frontmatter 写「输入:」(或 stdin:)。CLI 也可用管道或 --stdin-file。Live view 可用 Preset input 覆盖。 -*`名字` = > 输入 提示=名字: * +*`名字` = > 输入 提示="名字:"* > 打印 内容=你好 `名字`! diff --git a/public/stdlib/fs.mq.md b/public/stdlib/fs.mq.md index 746ecaa..a6b9678 100644 --- a/public/stdlib/fs.mq.md +++ b/public/stdlib/fs.mq.md @@ -10,7 +10,7 @@ Import lib/fs.mq.md. Functions: read_text, write_text, append_text, exists, list Bare path words must not contain a slash character (parsed as division). Prefer a same-folder name or a variable. -*`ok` = > fs.exists path=demo.txt * +*`ok` = > fs.exists path="demo.txt"* 1. `ok` > print text=demo-present diff --git a/public/stdlib/math.mq.md b/public/stdlib/math.mq.md index 8d3214c..00ac75a 100644 --- a/public/stdlib/math.mq.md +++ b/public/stdlib/math.mq.md @@ -21,18 +21,18 @@ Plotting (already in the library): plot / plot_points / plot_conic return SVG te diff / simplify / expand / partial subs return formula values so you can chain (e.g. differentiate twice, then plot or eval). -*`ty` = > type `f` * +*`ty` = > type `f`* > print text=`ty` -*`df` = > math.diff formula=`f` var=x * +*`df` = > math.diff formula=`f` var="x"* > print text=`df` -*`roots` = > math.solve formula=`f` var=x * +*`roots` = > math.solve formula=`f` var="x"* > print text=`roots` -*`_svg` = > math.plot formula=`f` var=x min=-3 max=3 * +*`_svg` = > math.plot formula=`f` var="x" min=-3 max=3* > print text=plot-ok diff --git a/public/stdlib/net.mq.md b/public/stdlib/net.mq.md index 769d2dc..d8befa4 100644 --- a/public/stdlib/net.mq.md +++ b/public/stdlib/net.mq.md @@ -8,6 +8,6 @@ import net:lib/net.mq.md Import lib/net.mq.md. Functions: http_get, http_post, http_post_sse, openai_sse_parse, http_request, url_encode. HTTPS and optional headers= map are supported. Default post content-type is JSON. `http_post_sse` / `openai_sse_parse` return OpenAI chat stream event lists (`delta` / `done`). -*`e` = > net.url_encode text=hello world * +*`e` = > net.url_encode text="hello world"* > print text=`e` diff --git a/public/stdlib/table.mq.md b/public/stdlib/table.mq.md index 47080ed..cf7fb8a 100644 --- a/public/stdlib/table.mq.md +++ b/public/stdlib/table.mq.md @@ -8,7 +8,7 @@ import table:lib/table.mq.md Prefer `table.put` for element updates (`at=` text key, **1-based** int, or list path). Use `json` for parse/stringify only. -*`h` = > table.put in=None at=Authorization value=Bearer-demo* +*`h` = > table.put in=None at="Authorization" value="Bearer-demo"* `xs` = @@ -17,7 +17,7 @@ Prefer `table.put` for element updates (`at=` text key, **1-based** int, or list | a | | b | -*`xs` = > table.put in=`xs` at=1 value=A* +*`xs` = > table.put in=`xs` at=1 value="A"* *`n` = > table.rows xs=`xs`* > print text=`h`[^Authorization] diff --git a/public/stdlib/text.mq.md b/public/stdlib/text.mq.md index fe4fb80..d0b026c 100644 --- a/public/stdlib/text.mq.md +++ b/public/stdlib/text.mq.md @@ -8,12 +8,12 @@ import text:lib/text.mq.md Import lib/text.mq.md. Functions: str_trim(s), str_split(s, sep), str_join(xs, sep). -*`t` = > text.str_trim s= marqdo * +*`t` = > text.str_trim s=" marqdo "* > print text=`t` -*`parts` = > text.str_split s=a,b,c sep=,* +*`parts` = > text.str_split s="a,b,c" sep=","* -*`j` = > text.str_join xs=`parts` sep=-* +*`j` = > text.str_join xs=`parts` sep="-"* > print text=`j` diff --git a/public/stdlib/数学.mq.md b/public/stdlib/数学.mq.md index e74f9b0..0223154 100644 --- a/public/stdlib/数学.mq.md +++ b/public/stdlib/数学.mq.md @@ -21,18 +21,18 @@ $$ 求导 / 化简 / 展开 / 未完全数值化的代入仍返回 formula,可继续链式调用(例如求二阶导后再绘图或求值)。 -*`ty` = > type `f` * +*`ty` = > type `f`* > print text=`ty` -*`df` = > 数学.求导 formula=`f` var=x * +*`df` = > 数学.求导 formula=`f` var="x"* > print text=`df` -*`roots` = > 数学.求解 formula=`f` var=x * +*`roots` = > 数学.求解 formula=`f` var="x"* > print text=`roots` -*`_svg` = > 数学.绘图 formula=`f` var=x min=-3 max=3 * +*`_svg` = > 数学.绘图 formula=`f` var="x" min=-3 max=3* > print text=plot-ok diff --git a/public/stdlib/文件.mq.md b/public/stdlib/文件.mq.md index 4597f7d..4bba0b0 100644 --- a/public/stdlib/文件.mq.md +++ b/public/stdlib/文件.mq.md @@ -10,7 +10,7 @@ description: 沙箱内读写文本 裸路径字面量不要写斜杠(会被当成除法)。可用同目录文件名或变量。 -*`ok` = > 文件.存在 路径=demo.txt * +*`ok` = > 文件.存在 路径="demo.txt"* 1. `ok` > 打印 内容=有演示文件 diff --git a/public/stdlib/文本.mq.md b/public/stdlib/文本.mq.md index 856f1ea..28dd99e 100644 --- a/public/stdlib/文本.mq.md +++ b/public/stdlib/文本.mq.md @@ -8,12 +8,12 @@ description: 去空白、拆分、拼接 导入 lib/文本.mq.md。函数:去空白(s)、拆分(s, sep)、拼接(xs, sep)。 -*`t` = > 文本.去空白 s= marqdo * +*`t` = > 文本.去空白 s=" marqdo "* > 打印 内容=`t` -*`parts` = > 文本.拆分 s=甲,乙,丙 sep=,* +*`parts` = > 文本.拆分 s="甲,乙,丙" sep=","* -*`j` = > 文本.拼接 xs=`parts` sep=-* +*`j` = > 文本.拼接 xs=`parts` sep="-"* > 打印 内容=`j` diff --git a/public/stdlib/网络.mq.md b/public/stdlib/网络.mq.md index 7a6725a..0399ab6 100644 --- a/public/stdlib/网络.mq.md +++ b/public/stdlib/网络.mq.md @@ -8,6 +8,6 @@ description: HTTP(S) 与地址编码 导入 lib/网络.mq.md。函数:获取(地址)、提交(地址, 内容;可选 content_type / headers)、编码地址(内容)。支持 HTTP 与 HTTPS(ureq)。 -*`e` = > 网络.编码地址 内容=你好 * +*`e` = > 网络.编码地址 内容="你好"* > 打印 内容=`e` diff --git a/public/structure/09-inherit.mq.md b/public/structure/09-inherit.mq.md index 0fd2d79..1a43ff3 100644 --- a/public/structure/09-inherit.mq.md +++ b/public/structure/09-inherit.mq.md @@ -8,7 +8,7 @@ description: "# Child = > Parent; methods walk the base chain" ## hello + `who` -*`msg` = "Hello, `who`!" * +*`msg` = "Hello, `who`!"* **`msg`** # Loud = > Greeter @@ -16,14 +16,14 @@ description: "# Child = > Parent; methods walk the base chain" ## hello + `who` -*`msg` = "HELLO, `who`!" * +*`msg` = "HELLO, `who`!"* **`msg`** # main -*`g` = > Greeter * -*`m` = > `g`.hello who=world * +*`g` = > Greeter* +*`m` = > `g`.hello who="world"* > print text=`m` -*`l` = > Loud * -*`m2` = > `l`.hello who=world * +*`l` = > Loud* +*`m2` = > `l`.hello who="world"* > print text=`m2` diff --git a/public/structure/09-继承.mq.md b/public/structure/09-继承.mq.md index 476f6b2..89f0630 100644 --- a/public/structure/09-继承.mq.md +++ b/public/structure/09-继承.mq.md @@ -8,7 +8,7 @@ description: "# 子类 = > 父类;方法沿基类链查找" ## 你好 + `谁` -*`msg` = "你好,`谁`!" * +*`msg` = "你好,`谁`!"* **`msg`** # 大声 = > 问候者 @@ -16,14 +16,14 @@ description: "# 子类 = > 父类;方法沿基类链查找" ## 你好 + `谁` -*`msg` = "你好,`谁`!!!" * +*`msg` = "你好,`谁`!!!"* **`msg`** # main -*`g` = > 问候者 * -*`m` = > `g`.你好 谁=世界 * +*`g` = > 问候者* +*`m` = > `g`.你好 谁="世界"* > 打印 内容=`m` -*`l` = > 大声 * -*`m2` = > `l`.你好 谁=世界 * +*`l` = > 大声* +*`m2` = > `l`.你好 谁="世界"* > 打印 内容=`m2`