feat(markup): finish v0.3 stock migration and green gold

Migrate remaining .mq.md (tests/ext/public/examples), stop elevating local assigns to params, inject form_target in Go libweb, and skip live LLM gold without a real key.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-13 23:43:44 +08:00
1 parent bfb10d172b
commit b5c07385e9
324 files changed
+4572 -4339

No files matched your search

+8 -8
View File
@@ -7,16 +7,16 @@ import cli:lib/cli.mq.md
# main
*raw = "name,score\nbob,2\nalice,10\n"*
*rows = > csv.parse text=`raw`*
*rows = > table.sort_by list=`rows` key="name"*
*r0 = > at value=`rows` index=0*
**raw = "name,score\nbob,2\nalice,10\n"**
**rows = > csv.parse text=`raw`**
**rows = > table.sort_by list=`rows` key="name"**
**r0 = > at value=`rows` index=0**
> print text=`r0`[^name]
*args = > split value="--input,data.csv,rest,--verbose" sep=","*
*flags = > cli.parse args=`args`*
**args = > split value="--input,data.csv,rest,--verbose" sep=","**
**flags = > cli.parse args=`args`**
> print text=`flags`[^input]
> print text=`flags`[^verbose]
*pos = `flags`[^_]*
*p0 = > at value=`pos` index=0*
**pos = `flags`[^_]**
**p0 = > at value=`pos` index=0**
> print text=`p0`
+7 -7
View File
@@ -5,17 +5,17 @@ import csv:lib/csv.mq.md
# main
*raw = "name,note\nalice,\"hi, there\"\nbob,ok\n"*
**raw = "name,note\nalice,\"hi, there\"\nbob,ok\n"**
*rows = > csv.parse text=`raw`*
*n = > len `rows`*
**rows = > csv.parse text=`raw`**
**n = > len `rows`**
> print text=`n`
*r0 = > at value=`rows` index=0*
**r0 = > at value=`rows` index=0**
> print text=`r0`[^name]
> print text=`r0`[^note]
*out = > csv.stringify rows=`rows`*
*rows2 = > csv.parse text=`out`*
*n2 = > len `rows2`*
**out = > csv.stringify rows=`rows`**
**rows2 = > csv.parse text=`out`**
**n2 = > len `rows2`**
> print text=`n2`
+7 -7
View File
@@ -5,19 +5,19 @@ import dt:lib/datetime.mq.md
# main
*m = > dt.from_unix unix=0*
**m = > dt.from_unix unix=0**
> print text=`m`[^iso]
*sh = > dt.in_zone dt=`m` zone="Asia/Shanghai"*
**sh = > dt.in_zone dt=`m` zone="Asia/Shanghai"**
> print text=`sh`[^iso]
*p = > dt.parse text="2020-01-02T03:04:05+08:00"*
*u = > dt.to_unix dt=`p`*
**p = > dt.parse text="2020-01-02T03:04:05+08:00"**
**u = > dt.to_unix dt=`p`**
> print text=`u`
*n = > dt.add dt=`m` days=1*
*nu = > dt.to_unix dt=`n`*
**n = > dt.add dt=`m` days=1**
**nu = > dt.to_unix dt=`n`**
> print text=`nu`
*d = > dt.format dt=`sh` style="date"*
**d = > dt.format dt=`sh` style="date"**
> print text=`d`
+4 -4
View File
@@ -5,14 +5,14 @@ import enc:lib/encoding.mq.md
# main
*b = > enc.base64_encode text="hello"*
**b = > enc.base64_encode text="hello"**
> print text=`b`
*back = > enc.base64_decode text=`b`*
**back = > enc.base64_decode text=`b`**
> print text=`back`
*h = > enc.hex_encode text="hi"*
**h = > enc.hex_encode text="hi"**
> print text=`h`
*hb = > enc.hex_decode text=`h`*
**hb = > enc.hex_decode text=`h`**
> print text=`hb`
+1 -1
View File
@@ -10,6 +10,6 @@ import foreign:lib/foreign.mq.md
print("hello-from-python")
```
*out = > foreign.run code=`hi`*
**out = > foreign.run code=`hi`**
> print text=`out`
+1 -1
View File
@@ -5,6 +5,6 @@ import foreign:lib/foreign.mq.md
# main
*out = > foreign.run_lang lang="python" source=print(2+2)*
**out = > foreign.run_lang lang="python" source=print(2+2)**
> print text=`out`
+4 -4
View File
@@ -9,20 +9,20 @@ import fs:lib/fs.mq.md
> fs.copy_file src="m2-src.txt" dest="m2-copy.txt"
*t = > fs.read_text path="m2-copy.txt"*
**t = > fs.read_text path="m2-copy.txt"**
> print text=`t`
> fs.move src="m2-copy.txt" dest="m2-moved.txt"
*ok = > fs.exists path="m2-moved.txt"*
**ok = > fs.exists path="m2-moved.txt"**
1. `ok`
> print text=moved
2. *
> print text=missing
*tmp = > fs.make_temp prefix="m2"*
**tmp = > fs.make_temp prefix="m2"**
> fs.write_text path=`tmp` text=temp-ok
*tt = > fs.read_text path=`tmp`*
**tt = > fs.read_text path=`tmp`**
> print text=`tt`
> fs.remove path="m2-src.txt"
+7 -7
View File
@@ -11,22 +11,22 @@ import fs:lib/fs.mq.md
> fs.write_text path="m9-tree/nested/b.txt" text="B"
*st = > fs.stat path="m9-tree/a.txt"*
**st = > fs.stat path="m9-tree/a.txt"**
> print text=`st`[^size]
> print text=`st`[^is_file]
> print text=`st`[^is_dir]
*w = > fs.walk path="m9-tree"*
*n = > len `w`*
**w = > fs.walk path="m9-tree"**
**n = > len `w`**
> print text=`n`
*p0 = > at value=`w` index=0*
*p1 = > at value=`w` index=1*
*p2 = > at value=`w` index=2*
**p0 = > at value=`w` index=0**
**p1 = > at value=`w` index=1**
**p2 = > at value=`w` index=2**
> print text=`p0`
> print text=`p1`
> print text=`p2`
> fs.remove_tree path="m9-tree"
*gone = > fs.exists path="m9-tree"*
**gone = > fs.exists path="m9-tree"**
> print text=`gone`
+2 -2
View File
@@ -5,13 +5,13 @@ import fs:lib/fs.mq.md
# main
*ok = > fs.exists path="hello.txt"*
**ok = > fs.exists path="hello.txt"**
1. `ok`
> print text=exists
2. *
> print text=missing
*t = > fs.read_text path="hello.txt"*
**t = > fs.read_text path="hello.txt"**
> print text=`t`
+4 -4
View File
@@ -5,14 +5,14 @@ import hash:lib/hash.mq.md
# main
*s = > hash.sha256 text=""*
**s = > hash.sha256 text=""**
> print text=`s`
*a = > hash.sha256 text="abc"*
**a = > hash.sha256 text="abc"**
> print text=`a`
*m = > hash.md5 text="hello"*
**m = > hash.md5 text="hello"**
> print text=`m`
*h = > hash.hmac_sha256 key="key" text="The quick brown fox jumps over the lazy dog"*
**h = > hash.hmac_sha256 key="key" text="The quick brown fox jumps over the lazy dog"**
> print text=`h`
+1 -1
View File
@@ -5,6 +5,6 @@ import json:lib/json.mq.md
# main
*q = > json.quote text="hi"*
**q = > json.quote text="hi"**
> print text=`q`
+5 -5
View File
@@ -6,18 +6,18 @@ import json:lib/json.mq.md
# main
*raw = > fs.read_text path="sample.json"*
**raw = > fs.read_text path="sample.json"**
*obj = > json.parse text=`raw`*
**obj = > json.parse text=`raw`**
*ty = > type `obj`*
**ty = > type `obj`**
> print text=`ty`
*a = > json.get value=`obj` key="a"*
**a = > json.get value=`obj` key="a"**
> print text=`a`
*out = > json.stringify value=`obj`*
**out = > json.stringify value=`obj`**
> print text=`out`
+3 -3
View File
@@ -15,8 +15,8 @@ import re:lib/re.mq.md
> log.debug text="shown-debug"
*id = > uuid.v4*
*n = > len `id`*
**id = > uuid.v4**
**n = > len `id`**
> print text=`n`
*ok = > re.is_match text=`id` pattern="^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"*
**ok = > re.is_match text=`id` pattern="^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"**
> print text=`ok`
+4 -4
View File
@@ -10,16 +10,16 @@ $$
x^3
$$
*df = > math.diff formula=`f` var="x"*
**df = > math.diff formula=`f` var="x"**
*ty = > type `df`*
**ty = > type `df`**
> print text=`ty`
*df2 = > math.diff formula=`df` var="x"*
**df2 = > math.diff formula=`df` var="x"**
> print text=`df2`
*y = > math.eval formula=`df` var="x" value=2*
**y = > math.eval formula=`df` var="x" value=2**
> print text=`y`
+4 -4
View File
@@ -10,18 +10,18 @@ $$
x^2 - 2
$$
*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`
*y = > math.eval formula=`f` var="x" value=3*
**y = > math.eval formula=`f` var="x" value=3**
> print text=`y`
+2 -2
View File
@@ -10,8 +10,8 @@ $$
x^2
$$
*svg = > math.plot formula=`f` var="x" min=-2 max=2*
**svg = > math.plot formula=`f` var="x" min=-2 max=2**
*ok = > type `svg`*
**ok = > type `svg`**
> print text=`ok`
+3 -3
View File
@@ -7,13 +7,13 @@ import math:lib/math.mq.md
> math.seed value=42
*a = > math.random_int min=1 max=10*
**a = > math.random_int min=1 max=10**
*b = > math.random_int min=1 max=10*
**b = > math.random_int min=1 max=10**
> math.seed value=42
*c = > math.random_int min=1 max=10*
**c = > math.random_int min=1 max=10**
> print text=`a`
+2 -2
View File
@@ -5,9 +5,9 @@ import net:lib/net.mq.md
# main
*req = > net.cookie_parse text="session=abc123; theme=dark"*
**req = > net.cookie_parse text="session=abc123; theme=dark"**
*resp = > net.cookie_parse text="id=42; Path=/; HttpOnly; Secure; SameSite=Lax, theme=light; Max-Age=3600" is_response=True*
**resp = > net.cookie_parse text="id=42; Path=/; HttpOnly; Secure; SameSite=Lax, theme=light; Max-Age=3600" is_response=True**
> print text=`req`[^1][^name]
> print text=`req`[^1][^value]
+1 -1
View File
@@ -5,6 +5,6 @@ import net:lib/net.mq.md
# main
*e = > net.url_encode text=a b*
**e = > net.url_encode text=a b**
> print text=`e`
+1 -1
View File
@@ -5,7 +5,7 @@ import net:lib/net.mq.md
# main
*html = > net.markdown_parse text="# Title\n\nHello **world**."*
**html = > net.markdown_parse text="# Title\n\nHello **world**."**
1. `html` != ""
> print text=markdown-ok
2. *
+1 -1
View File
@@ -9,7 +9,7 @@ import net:lib/net.mq.md
`body` = "--`boundary`\nContent-Disposition: form-data; name=\"title\"\n\nHello\n--`boundary`\nContent-Disposition: form-data; name=\"file\"; filename=\"a.txt\"\nContent-Type: text/plain\n\nfile body\n--`boundary`--\n"
*parts = > net.multipart_parse body=`body` boundary=`boundary`*
**parts = > net.multipart_parse body=`body` boundary=`boundary`**
> print text=`parts`[^1][^name]
> print text=`parts`[^1][^value]
+12 -12
View File
@@ -7,26 +7,26 @@ import json:lib/json.mq.md
# main
*fixture = "data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"think\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"Hi\"}}]}\n\ndata: [DONE]\n"*
**fixture = "data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"think\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"Hi\"}}]}\n\ndata: [DONE]\n"**
*events = > net.openai_sse_parse text=`fixture`*
*n = > len value=`events`*
**events = > net.openai_sse_parse text=`fixture`**
**n = > len value=`events`**
> print text=`n`
*e0 = > at value=`events` index=0*
*t0 = > json.get value=`e0` key="type"*
*x0 = > json.get value=`e0` key="text"*
**e0 = > at value=`events` index=0**
**t0 = > json.get value=`e0` key="type"**
**x0 = > json.get value=`e0` key="text"**
> print text=`t0`
> print text=`x0`
*e1 = > at value=`events` index=1*
*t1 = > json.get value=`e1` key="type"*
*x1 = > json.get value=`e1` key="text"*
**e1 = > at value=`events` index=1**
**t1 = > json.get value=`e1` key="type"**
**x1 = > json.get value=`e1` key="text"**
> print text=`t1`
> print text=`x1`
*e2 = > at value=`events` index=2*
*t2 = > json.get value=`e2` key="type"*
*r2 = > json.get value=`e2` key="result"*
**e2 = > at value=`events` index=2**
**t2 = > json.get value=`e2` key="type"**
**r2 = > json.get value=`e2` key="result"**
> print text=`t2`
> print text=`r2`
+5 -5
View File
@@ -6,17 +6,17 @@ import json:lib/json.mq.md
# main
*fixture = "data: {\"choices\":[{\"delta\":{\"content\":\"Hel\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"lo\"}}]}\n\ndata: [DONE]\n"*
**fixture = "data: {\"choices\":[{\"delta\":{\"content\":\"Hel\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"lo\"}}]}\n\ndata: [DONE]\n"**
*events = > net.openai_sse_parse text=`fixture`*
**events = > net.openai_sse_parse text=`fixture`**
- [`ev`](`events`)
*t = > json.get value=`ev` key="type"*
**t = > json.get value=`ev` key="type"**
1. `t` == "delta"
*chunk = > json.get value=`ev` key="text"*
**chunk = > json.get value=`ev` key="text"**
> print text=`chunk`
2. `t` == "done"
*answer = > json.get value=`ev` key="result"*
**answer = > json.get value=`ev` key="result"**
> print text=`answer`
3. *
> print text=bad
+8 -8
View File
@@ -5,24 +5,24 @@ import path:lib/path.mq.md
# main
*j = > path.join a="dir/sub" b="f.txt"*
**j = > path.join a="dir/sub" b="f.txt"**
> print text=`j`
*name = > path.file_name path=`j`*
**name = > path.file_name path=`j`**
> print text=`name`
*ext = > path.extension path=`j`*
**ext = > path.extension path=`j`**
> print text=`ext`
*par = > path.parent path=`j`*
**par = > path.parent path=`j`**
> print text=`par`
*norm = > path.normalize path="a/./b/../c"*
**norm = > path.normalize path="a/./b/../c"**
> print text=`norm`
*abs = > path.is_absolute path="/tmp/x"*
**abs = > path.is_absolute path="/tmp/x"**
> print text=`abs`
*parts = > path.split path="a/b/c"*
*pj = > join value=`parts` sep="|"*
**parts = > path.split path="a/b/c"**
**pj = > join value=`parts` sep="|"**
> print text=`pj`
+3 -3
View File
@@ -7,14 +7,14 @@ import sys:lib/sys.mq.md
# main
*p = > sys.env_get name="MARQDO_TEST_PLUGIN"*
**p = > sys.env_get name="MARQDO_TEST_PLUGIN"**
> plugin.load path=`p`
*sum = > demo_add a=1 b=2*
**sum = > demo_add a=1 b=2**
> print text=`sum`
*echo = > demo_echo text="ok"*
**echo = > demo_echo text="ok"**
> print text=`echo`
+7 -7
View File
@@ -5,19 +5,19 @@ import re:lib/re.mq.md
# main
*ok = > re.is_match text="abc123" pattern="\\d+"*
**ok = > re.is_match text="abc123" pattern="\\d+"**
> print text=`ok`
*m = > re.find text="ab12cd34" pattern="\\d+"*
**m = > re.find text="ab12cd34" pattern="\\d+"**
> print text=`m`
*all = > re.find_all text="a1b22c333" pattern="\\d+"*
*joined = > join value=`all` sep=","*
**all = > re.find_all text="a1b22c333" pattern="\\d+"**
**joined = > join value=`all` sep=","**
> print text=`joined`
*rep = > re.replace text="a1b2c3" pattern="\\d+" with="X" count=2*
**rep = > re.replace text="a1b2c3" pattern="\\d+" with="X" count=2**
> print text=`rep`
*parts = > re.split text="a-b-c" pattern="-"*
*pj = > join value=`parts` sep="|"*
**parts = > re.split text="a-b-c" pattern="-"**
**pj = > join value=`parts` sep="|"**
> print text=`pj`
+4 -4
View File
@@ -5,10 +5,10 @@ import sec:lib/secrets.mq.md
# main
*t = > sec.token_hex n=8*
*L = > len `t`*
**t = > sec.token_hex n=8**
**L = > len `t`**
> print text=`L`
*u = > sec.token_urlsafe n=9*
*ul = > len `u`*
**u = > sec.token_urlsafe n=9**
**ul = > len `u`**
> print text=`ul`
+3 -3
View File
@@ -15,13 +15,13 @@ import log:lib/log.mq.md
| 3 |
| 4 |
*m = > stats.mean list=`xs`*
**m = > stats.mean list=`xs`**
> print text=`m`
*med = > stats.median list=`xs`*
**med = > stats.median list=`xs`**
> print text=`med`
*s = > stats.stdev list=`xs`*
**s = > stats.stdev list=`xs`**
> print text=`s`
`fld` =
+1 -1
View File
@@ -6,4 +6,4 @@ title: subtask child that prints
> print text=hello-from-child
**"child_ok"**
*"child_ok"*
+1 -1
View File
@@ -4,4 +4,4 @@ title: subtask child
# main
**"child_ok"**
*"child_ok"*
+4 -4
View File
@@ -6,11 +6,11 @@ import json:lib/json.mq.md
# main
*args = > json.parse text={"n":21}*
**args = > json.parse text={"n":21}**
*id = > subtask.spawn fn="worker" args=`args`*
**id = > subtask.spawn fn="worker" args=`args`**
*v = > subtask.wait id=`id`*
**v = > subtask.wait id=`id`**
> print text=`v`
@@ -19,4 +19,4 @@ import json:lib/json.mq.md
## worker
+ `n`
**n * 2**
*n * 2*
+2 -2
View File
@@ -10,8 +10,8 @@ import subtask:lib/subtask.mq.md
print(7 + 8)
```
*id = > subtask.spawn code=`py`*
**id = > subtask.spawn code=`py`**
*out = > subtask.wait id=`id`*
**out = > subtask.wait id=`id`**
> print text=`out`
+5 -5
View File
@@ -6,11 +6,11 @@ import json:lib/json.mq.md
# main
*id = > subtask.spawn path="subtask-child-print.mq.md"*
*waited = > subtask.wait id=`id`*
*code = > json.get value=`waited` key="code"*
*val = > json.get value=`waited` key="value"*
*stdout = > json.get value=`waited` key="stdout"*
**id = > subtask.spawn path="subtask-child-print.mq.md"**
**waited = > subtask.wait id=`id`**
**code = > json.get value=`waited` key="code"**
**val = > json.get value=`waited` key="value"**
**stdout = > json.get value=`waited` key="stdout"**
1. `code` == 0
1. `val` == "child_ok"
+8 -8
View File
@@ -6,11 +6,11 @@ import json:lib/json.mq.md
# main
*id = > subtask.spawn path="subtask-child.mq.md" quiet=False*
**id = > subtask.spawn path="subtask-child.mq.md" quiet=False**
*waited = > subtask.wait id=`id`*
*code = > json.get value=`waited` key="code"*
*val = > json.get value=`waited` key="value"*
**waited = > subtask.wait id=`id`**
**code = > json.get value=`waited` key="code"**
**val = > json.get value=`waited` key="value"**
1. `code` == 0
> print text=`val`
@@ -19,11 +19,11 @@ import json:lib/json.mq.md
> print text=done
*id2 = > subtask.spawn path="subtask-child.mq.md"*
**id2 = > subtask.spawn path="subtask-child.mq.md"**
*waited2 = > subtask.wait id=`id2`*
*code2 = > json.get value=`waited2` key="code"*
*val2 = > json.get value=`waited2` key="value"*
**waited2 = > subtask.wait id=`id2`**
**code2 = > json.get value=`waited2` key="code"**
**val2 = > json.get value=`waited2` key="value"**
1. `code2` == 0
1. `val2` == "child_ok"
+2 -2
View File
@@ -5,9 +5,9 @@ import sys:lib/sys.mq.md
# main
*d = > sys.cwd*
**d = > sys.cwd**
*n = > len `d`*
**n = > len `d`**
1. `n` > 0
> print text=cwd-ok
+1 -1
View File
@@ -10,6 +10,6 @@ import fs:lib/fs.mq.md
> sys.load_dotenv path=dotenv-fixture.env
*v = > sys.env_get name="MARQDO_DOTENV_FIXTURE"*
**v = > sys.env_get name="MARQDO_DOTENV_FIXTURE"**
> print text=`v`
+5 -5
View File
@@ -7,16 +7,16 @@ import json:lib/json.mq.md
# main
*code = > sys.exec cmd="true"*
**code = > sys.exec cmd="true"**
1. `code` == 0
> print text=exec-code-ok
2. *
> print text=exec-code-fail
*args = > json.parse text=["-c","printf hi-capture"]*
*out = > sys.exec cmd="sh" args=args capture=True*
*c = out[^code]*
*s = out[^stdout]*
**args = > json.parse text=["-c","printf hi-capture"]**
**out = > sys.exec cmd="sh" args=args capture=True**
**c = out[^code]**
**s = out[^stdout]**
1. `c` == 0
> print text=capture-code-ok
2. *
+13 -13
View File
@@ -6,7 +6,7 @@ import table:lib/table.mq.md
# main
*h = > table.put in=None at="Authorization" value="Bearer-x"*
**h = > table.put in=None at="Authorization" value="Bearer-x"**
> print text=`h`[^Authorization]
`xs` =
@@ -16,7 +16,7 @@ import table:lib/table.mq.md
| a |
| b |
*xs = > table.put in=`xs` at=1 value="A"*
**xs = > table.put in=`xs` at=1 value="A"**
> print text=`xs`[^1]
> print text=`xs`[^2]
@@ -26,22 +26,22 @@ import table:lib/table.mq.md
|-------|----------|
| m1 | None |
*msg = > table.put in=None at="role" value="user"*
*msg = > table.put in=`msg` at="content" value="hi"*
*messages = > table.append list=None item=`msg`*
*req = > table.put in=`req` at="messages" value=`messages`*
*req = > table.put in=`req` at="stream" value=True*
**msg = > table.put in=None at="role" value="user"**
**msg = > table.put in=`msg` at="content" value="hi"**
**messages = > table.append list=None item=`msg`**
**req = > table.put in=`req` at="messages" value=`messages`**
**req = > table.put in=`req` at="stream" value=True**
> print text=`req`[^messages][^1][^content]
> print text=`req`[^stream]
*xs = > table.append list=`xs` item="c"*
*n = > table.len xs=`xs`*
**xs = > table.append list=`xs` item="c"**
**n = > table.len xs=`xs`**
> print text=`n`
*m = > table.merge a=`h` b=`msg`*
*ks = > table.keys map=`m`*
**m = > table.merge a=`h` b=`msg`**
**ks = > table.keys map=`m`**
> print text=`ks`
*empty = > table.empty_map*
*sz = > table.size map=`empty`*
**empty = > table.empty_map**
**sz = > table.size map=`empty`**
> print text=`sz`
+15 -15
View File
@@ -5,27 +5,27 @@ import table:lib/table.mq.md
# main
*xs = > split value="3,1,2,1" sep=","*
*xs = > table.sort list=`xs`*
*s = > join value=`xs` sep=","*
**xs = > split value="3,1,2,1" sep=","**
**xs = > table.sort list=`xs`**
**s = > join value=`xs` sep=","**
> print text=`s`
*u = > table.unique list=`xs`*
*uj = > join value=`u` sep=","*
**u = > table.unique list=`xs`**
**uj = > join value=`u` sep=","**
> print text=`uj`
*ch = > table.chunk list=`xs` size=2*
*n = > len `ch`*
**ch = > table.chunk list=`xs` size=2**
**n = > len `ch`**
> print text=`n`
*a = > split value="a,b" sep=","*
*b = > split value="1,2,3" sep=","*
*z = > table.zip a=`a` b=`b`*
*zn = > len `z`*
**a = > split value="a,b" sep=","**
**b = > split value="1,2,3" sep=","**
**z = > table.zip a=`a` b=`b`**
**zn = > len `z`**
> print text=`zn`
*nested = > table.append list=None item=`a`*
*nested = > table.append list=`nested` item=`b`*
*flat = > table.flatten list=`nested`*
*fj = > join value=`flat` sep=","*
**nested = > table.append list=None item=`a`**
**nested = > table.append list=`nested` item=`b`**
**flat = > table.flatten list=`nested`**
**fj = > join value=`flat` sep=","**
> print text=`fj`
+5 -5
View File
@@ -5,17 +5,17 @@ import text:lib/text.mq.md
# main
*c = > text.contains text="Hello" sub="ell"*
**c = > text.contains text="Hello" sub="ell"**
> print text=`c`
*u = > text.to_upper text="ab"*
**u = > text.to_upper text="ab"**
> print text=`u`
*r = > text.replace text="a-a-a" old="-" new="_" count=2*
**r = > text.replace text="a-a-a" old="-" new="_" count=2**
> print text=`r`
*p = > text.pad text="x" width=4 fill="." align="right"*
**p = > text.pad text="x" width=4 fill="." align="right"**
> print text=`p`
*rep = > text.repeat text="ab" n=3*
**rep = > text.repeat text="ab" n=3**
> print text=`rep`
+2 -2
View File
@@ -5,11 +5,11 @@ import time:lib/time.mq.md
# main
*s = > time.format unix=0 pattern=%Y-%m-%d*
**s = > time.format unix=0 pattern=%Y-%m-%d**
> print text=`s`
*u = > time.parse text=1970-01-01 00:00:00 pattern=%Y-%m-%d %H:%M:%S*
**u = > time.parse text=1970-01-01 00:00:00 pattern=%Y-%m-%d %H:%M:%S**
> print text=`u`
+6 -6
View File
@@ -7,18 +7,18 @@ import enc:lib/encoding.mq.md
# main
*cfg = > toml.parse text="name = \"marqdo\"\ncount = 2\n[pkg]\nver = \"1\"\n"*
**cfg = > toml.parse text="name = \"marqdo\"\ncount = 2\n[pkg]\nver = \"1\"\n"**
> print text=`cfg`[^name]
> print text=`cfg`[^count]
*pkg = `cfg`[^pkg]*
**pkg = `cfg`[^pkg]**
> print text=`pkg`[^ver]
*e = > html.escape text="a<b>&\"c'"*
**e = > html.escape text="a<b>&\"c'"**
> print text=`e`
*u = > html.unescape text=`e`*
**u = > html.unescape text=`e`**
> print text=`u`
*b = > enc.base32_encode text="hello"*
**b = > enc.base32_encode text="hello"**
> print text=`b`
*back = > enc.base32_decode text=`b`*
**back = > enc.base32_decode text=`b`**
> print text=`back`
+6 -6
View File
@@ -5,7 +5,7 @@ import url:lib/url.mq.md
# main
*u = > url.parse text="https://example.com:8443/a/b?x=1&y=2#frag"*
**u = > url.parse text="https://example.com:8443/a/b?x=1&y=2#frag"**
> print text=`u`[^scheme]
> print text=`u`[^host]
> print text=`u`[^port]
@@ -13,13 +13,13 @@ import url:lib/url.mq.md
> print text=`u`[^query]
> print text=`u`[^fragment]
*q = > url.query_parse text="a=1&b=hi%20x&a=2"*
**q = > url.query_parse text="a=1&b=hi%20x&a=2"**
> print text=`q`[^b]
*as = `q`[^a]*
*a0 = > at value=`as` index=0*
*a1 = > at value=`as` index=1*
**as = `q`[^a]**
**a0 = > at value=`as` index=0**
**a1 = > at value=`as` index=1**
> print text=`a0`
> print text=`a1`
*s = > url.query_stringify map=`q`*
**s = > url.query_stringify map=`q`**
> print text=`s`
+3 -3
View File
@@ -18,7 +18,7 @@ import json:lib/json.mq.md
# main
*anchor = > host_outer_call_line*
**anchor = > host_outer_call_line**
<!-- marqdo-out ok
async-ok
-->
@@ -30,8 +30,8 @@ async-ok
pending
-->
*wb = > json.parse text={"key":"ok","value":"async-ok"}*
*wb = > json.set map=`wb` key=line value=`anchor`*
**wb = > json.parse text={"key":"ok","value":"async-ok"}**
**wb = > json.set map=`wb` key=line value=`anchor`**
> subtask.spawn fn=persist_slot args=`wb`
> print text=spawned
+1 -1
View File
@@ -5,7 +5,7 @@ import writeback:lib/writeback.mq.md
# main
*out = > writeback.get*
**out = > writeback.get**
<!-- marqdo-out
hello-writeback
+2 -2
View File
@@ -5,8 +5,8 @@ title: lib/哈希 烟测
# main
*s = > 哈希.哈希256 内容=""*
**s = > 哈希.哈希256 内容=""**
> 打印 内容=`s`
*m = > 哈希.md5 内容="hello"*
**m = > 哈希.md5 内容="hello"**
> 打印 内容=`m`
+1 -1
View File
@@ -5,7 +5,7 @@ title: lib/地址 烟测
# main
*u = > 址.解析 内容="https://example.com/a?x=1"*
**u = > 址.解析 内容="https://example.com/a?x=1"**
> print text=`u`[^scheme]
> print text=`u`[^host]
> print text=`u`[^path]
+1 -1
View File
@@ -10,6 +10,6 @@ title: foreign zh
print("中文外联")
```
*out = > 外联.运行 代码=`hi`*
**out = > 外联.运行 代码=`hi`**
> print text=`out`
+3 -3
View File
@@ -5,12 +5,12 @@ title: math num + zh
# main
*p = > 数学.圆周率*
**p = > 数学.圆周率**
*t = > type `p`*
**t = > type `p`**
> print text=`t`
*s = > 数学.正弦 value=0*
**s = > 数学.正弦 value=0**
> print text=`s`
+4 -4
View File
@@ -9,14 +9,14 @@ title: 文件 Mid2 M9 烟测
> 文件.写文本 路径="m9-zh/a.txt" 内容="A"
*st = > 文件.状态 路径="m9-zh/a.txt"*
**st = > 文件.状态 路径="m9-zh/a.txt"**
> print text=`st`[^is_file]
*w = > 文件.遍历 路径="m9-zh"*
*n = > 长度 `w`*
**w = > 文件.遍历 路径="m9-zh"**
**n = > 长度 `w`**
> print text=`n`
> 文件.删目录树 路径="m9-zh"
*gone = > 文件.存在 路径="m9-zh"*
**gone = > 文件.存在 路径="m9-zh"**
> print text=`gone`
+1 -1
View File
@@ -7,7 +7,7 @@ title: 文件 复制移动
> 文件.写文本 路径="m2-zh-src.txt" 内容="zh-body"
> 文件.复制文件 源="m2-zh-src.txt" 目标="m2-zh-copy.txt"
*t = > 文件.读文本 路径="m2-zh-copy.txt"*
**t = > 文件.读文本 路径="m2-zh-copy.txt"**
> 打印 内容=`t`
> 文件.删除 路径="m2-zh-src.txt"
> 文件.删除 路径="m2-zh-copy.txt"
+2 -2
View File
@@ -5,13 +5,13 @@ title: 中文文件库
# main
*有 = > 文件.存在 路径="hello.txt"*
**有 = > 文件.存在 路径="hello.txt"**
1. `有`
> 打印 内容=存在
2. *
> 打印 内容=缺失
*t = > 文件.读文本 路径="hello.txt"*
**t = > 文件.读文本 路径="hello.txt"**
> 打印 内容=`t`
+3 -3
View File
@@ -5,11 +5,11 @@ title: lib/文本 加厚烟测
# main
*c = > 文本.包含 内容="Hello" 子串="ell"*
**c = > 文本.包含 内容="Hello" 子串="ell"**
> 打印 内容=`c`
*u = > 文本.大写 内容="ab"*
**u = > 文本.大写 内容="ab"**
> 打印 内容=`u`
*r = > 文本.替换 内容="a-a-a" 旧="-" 新="_" 次数=1*
**r = > 文本.替换 内容="a-a-a" 旧="-" 新="_" 次数=1**
> 打印 内容=`r`
+2 -2
View File
@@ -8,6 +8,6 @@ title: lib/日志与标识 烟测
> 日志.信息 内容="中文信息"
*id = > 标识.版本4*
*n = > 长度 `id`*
**id = > 标识.版本4**
**n = > 长度 `id`**
> 打印 内容=`n`
+4 -4
View File
@@ -5,12 +5,12 @@ title: lib/日期时间 烟测
# main
*m = > 日时.自戳 秒=0*
**m = > 日时.自戳 秒=0**
> print text=`m`[^iso]
*sh = > 日时.时区 时刻=`m` 区="Asia/Shanghai"*
**sh = > 日时.时区 时刻=`m` 区="Asia/Shanghai"**
> print text=`sh`[^iso]
*p = > 日时.解析 内容="2020-01-02T03:04:05+08:00"*
*u = > 日时.成戳 时刻=`p`*
**p = > 日时.解析 内容="2020-01-02T03:04:05+08:00"**
**u = > 日时.成戳 时刻=`p`**
> print text=`u`
+2 -2
View File
@@ -5,6 +5,6 @@ title: lib/机密 烟测
# main
*t = > 机密.十六进制令牌 字节数=8*
*L = > 长度 `t`*
**t = > 机密.十六进制令牌 字节数=8**
**L = > 长度 `t`**
> 打印 内容=`L`
+4 -4
View File
@@ -5,12 +5,12 @@ title: lib/正则 烟测
# main
*ok = > 正则.匹配 内容="abc123" 模式="\\d+"*
**ok = > 正则.匹配 内容="abc123" 模式="\\d+"**
> 打印 内容=`ok`
*m = > 正则.查找 内容="ab12cd34" 模式="\\d+"*
**m = > 正则.查找 内容="ab12cd34" 模式="\\d+"**
> 打印 内容=`m`
*all = > 正则.查找全部 内容="a1b22c333" 模式="\\d+"*
*joined = > join value=`all` sep=","*
**all = > 正则.查找全部 内容="a1b22c333" 模式="\\d+"**
**joined = > join value=`all` sep=","**
> 打印 内容=`joined`
+1 -1
View File
@@ -13,7 +13,7 @@ title: lib/统计 日志 M10 烟测
| 2 |
| 4 |
*m = > 统计.均值 列表=`xs`*
**m = > 统计.均值 列表=`xs`**
> print text=`m`
`fld` =
+4 -4
View File
@@ -5,14 +5,14 @@ title: lib/编码 烟测
# main
*b = > 编码.基64编码 内容="hello"*
**b = > 编码.基64编码 内容="hello"**
> 打印 内容=`b`
*back = > 编码.基64解码 内容=`b`*
**back = > 编码.基64解码 内容=`b`**
> 打印 内容=`back`
*h = > 编码.十六进制编码 内容="hi"*
**h = > 编码.十六进制编码 内容="hi"**
> 打印 内容=`h`
*hb = > 编码.十六进制解码 内容=`h`*
**hb = > 编码.十六进制解码 内容=`h`**
> 打印 内容=`hb`
+5 -5
View File
@@ -6,12 +6,12 @@ title: 表与命令行 烟测
# main
*xs = > split value="c,a,b" sep=","*
*xs = > 表.排序 list=`xs`*
*s = > join value=`xs` sep=","*
**xs = > split value="c,a,b" sep=","**
**xs = > 表.排序 list=`xs`**
**s = > join value=`xs` sep=","**
> 打印 内容=`s`
*args = > split value="--x,1,--flag" sep=","*
*flags = > 命令行.解析 参数=`args`*
**args = > split value="--x,1,--flag" sep=","**
**flags = > 命令行.解析 参数=`args`**
> 打印 内容=`flags`[^x]
> 打印 内容=`flags`[^flag]
+4 -4
View File
@@ -6,7 +6,7 @@ description: 改 + 列表字典
# main
*h = > 表.改 入=None 于="Authorization" 值="Bearer-x"*
**h = > 表.改 入=None 于="Authorization" 值="Bearer-x"**
> 打印 内容=`h`[^Authorization]
`xs` =
@@ -16,9 +16,9 @@ description: 改 + 列表字典
| a |
| b |
*xs = > 表.改 入=`xs` 于=1 值="A"*
**xs = > 表.改 入=`xs` 于=1 值="A"**
> 打印 内容=`xs`[^1]
*xs = > 表.追加 list=`xs` item="c"*
*n = > 表.长度 xs=`xs`*
**xs = > 表.追加 list=`xs` item="c"**
**n = > 表.长度 xs=`xs`**
> 打印 内容=`n`
+4 -4
View File
@@ -5,14 +5,14 @@ title: lib/路径 烟测
# main
*j = > 路径.拼接 甲="dir/sub" 乙="f.txt"*
**j = > 路径.拼接 甲="dir/sub" 乙="f.txt"**
> 打印 内容=`j`
*name = > 路径.文件名 路径=`j`*
**name = > 路径.文件名 路径=`j`**
> 打印 内容=`name`
*ext = > 路径.扩展名 路径=`j`*
**ext = > 路径.扩展名 路径=`j`**
> 打印 内容=`ext`
*norm = > 路径.规范化 路径="a/./b/../c"*
**norm = > 路径.规范化 路径="a/./b/../c"**
> 打印 内容=`norm`
+4 -4
View File
@@ -5,11 +5,11 @@ title: lib/逗号表 烟测
# main
*raw = "a,b\n1,2\n"*
**raw = "a,b\n1,2\n"**
*rows = > 逗号表.解析 内容=`raw`*
*n = > 长度 `rows`*
**rows = > 逗号表.解析 内容=`raw`**
**n = > 长度 `rows`**
> 打印 内容=`n`
*r0 = > at value=`rows` index=0*
**r0 = > at value=`rows` index=0**
> 打印 内容=`r0`[^a]
@@ -7,12 +7,12 @@ title: lib/配置表 超文本 编码 烟测
# main
*cfg = > 配置.解析 内容="name = \"中文\"\nok = true\n"*
**cfg = > 配置.解析 内容="name = \"中文\"\nok = true\n"**
> print text=`cfg`[^name]
> print text=`cfg`[^ok]
*e = > 超.转义 内容="a<b>"*
**e = > 超.转义 内容="a<b>"**
> print text=`e`
*b = > 编.基32编码 内容="hi"*
**b = > 编.基32编码 内容="hi"**
> print text=`b`