feat(markup): adopt v0.3 as sole mapping (** code, * return)

Make prose-unified Markup the only runtime: bold segments are executable,
italic is return, params can be inferred from body/prose, with no v0.2 dual
mode. Migrate lib and structure/keywords golds; gate on tests/markup-v03.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-13 20:38:53 +08:00
1 parent 00a77181ef
commit bfb10d172b
114 files changed
+2271 -732

No files matched your search

+11 -11
View File
@@ -1,37 +1,37 @@
---
title: bare id in italic and bold
description: Inside *…* / **…**, bare ids are variables; strings need quotes.
description: Inside **…** / *…*, bare ids are variables; strings need quotes.
---
# main
*answer = 1*
*n = answer + 1*
*ticked = 2*
*s = 'quoted'*
**answer = 1**
**n = answer + 1**
**ticked = 2**
**s = 'quoted'**
> print text=`n`
> print text=`ticked`
> print text=`s`
*a = > ret_var x=7*
**a = > ret_var x=7**
> print text=`a`
*b = > ret_str*
**b = > ret_str**
> print text=`b`
*c = > ret_single*
**c = > ret_single**
> print text=`c`
## ret_var
+ `x`
**x**
*x*
## ret_str
**"ok"**
*"ok"*
## ret_single
**'hi'**
*'hi'*
+2 -2
View File
@@ -5,8 +5,8 @@ description: Same-indent `1.` after a completed list is a new Branch, not more a
# main
*a = True*
*b = True*
**a = True**
**b = True**
1. `a`
> print text=A
+1 -1
View File
@@ -4,7 +4,7 @@ title: 分支示例
# main
*x = 0*
**x = 0**
1. `x` > 0
> print text=正数
+2 -2
View File
@@ -5,8 +5,8 @@ description: Data cells evaluate like call-arg values (`var`, paths, hyphen pros
# main
*secret = "sk-live"*
*name = "gpt-4o-mini"*
**secret = "sk-live"**
**name = "gpt-4o-mini"**
`cfg` =
+3 -3
View File
@@ -11,14 +11,14 @@ title: 横表多行 → 字典套列表
| 红富士 | 青瓜 |
| 嘎啦 | 黄瓜条 |
*第一种苹果 = 货架[^苹果][^1]*
**第一种苹果 = 货架[^苹果][^1]**
> print text=`第一种苹果`
*列 = 货架[^苹果]*
**列 = 货架[^苹果]**
> print text=`列`
*第二种黄瓜 = 货架[^黄瓜][^2]*
**第二种黄瓜 = 货架[^黄瓜][^2]**
> print text=`第二种黄瓜`
+3 -3
View File
@@ -10,15 +10,15 @@ title: 横表单行 → 字典
|------|------|------|
| 水果 | 蔬菜 | 数码用品 |
*种 = 分类[^苹果]*
**种 = 分类[^苹果]**
> print text=`种`
*种 = 分类[^黄瓜]*
**种 = 分类[^黄瓜]**
> print text=`种`
*种 = 分类[^鼠标]*
**种 = 分类[^鼠标]**
> print text=`种`
+2 -2
View File
@@ -11,10 +11,10 @@ title: row records with @ marker
| 1 | apple | 2 |
| 2 | pear | 3 |
*n = orders[^1][^name]*
**n = orders[^1][^name]**
> print text=`n`
*q = orders[^2][^qty]*
**q = orders[^2][^qty]**
> print text=`q`
+3 -3
View File
@@ -11,15 +11,15 @@ title: 行向记录表(首列 行 / @)
| 1 | 苹果 | 2 |
| 2 | 梨 | 3 |
*第一 = 订单[^1]*
**第一 = 订单[^1]**
> print text=`第一`
*名 = 订单[^1][^品名]*
**名 = 订单[^1][^品名]**
> print text=`名`
*量 = 订单[^2][^数量]*
**量 = 订单[^2][^数量]**
> print text=`量`
+3 -3
View File
@@ -12,14 +12,14 @@ title: 脚注取元(列表下标)
| 梨 |
| 桃 |
*第一 = 篮子[^1]*
**第一 = 篮子[^1]**
> print text=`第一`
*第二 = 篮子[^2]*
**第二 = 篮子[^2]**
> print text=`第二`
*第三 = 篮子[^3]*
**第三 = 篮子[^3]**
> print text=`第三`
+2 -2
View File
@@ -11,8 +11,8 @@ description: Pure-digit labels are map keys (text), not list indices. Bare base
|----|----|
| half | other |
*a = p[^00]*
*b = p[^11]*
**a = p[^00]**
**b = p[^11]**
> print text=`a`
> print text=`b`
+13 -13
View File
@@ -6,9 +6,9 @@ import json:lib/json.mq.md
# main
*a = > case_backtick*
*b = > case_json_array*
*c = > case_recover*
**a = > case_backtick**
**b = > case_json_array**
**c = > case_recover**
> print text=`a`
> print text=`b`
> print text=`c`
@@ -21,20 +21,20 @@ import json:lib/json.mq.md
|---|
| ok |
*code = > len value=`args`*
*y = 1*
**y**
**code = > len value=`args`**
**y = 1**
*y*
## case_json_array
*xs = > json.parse text=["scripts/legacy/web_search.py"]*
*n = > len value=`xs`*
**n**
**xs = > json.parse text=["scripts/legacy/web_search.py"]**
**n = > len value=`xs`**
*n*
## case_recover
故意少写闭合星号,后续语句仍须可执行:
故意少写闭合粗体,后续语句仍须可执行:
*c = > json.parse text=[]`
*z = 7*
**z**
**c = > json.parse text=[]
**z = 7**
*z*
+1 -1
View File
@@ -1,5 +1,5 @@
# Hello World
本程序调用内置函数 `print` 打印问候。注释里的 **粗体** 与 *斜体* 都不执行。
本程序调用内置函数 print 打印问候。叙述中不要用星号当强调(粗体/斜体已是可执行标记)。
> print text=Hello World!
+3 -3
View File
@@ -6,7 +6,7 @@ title: import official lib (Chinese)
# main
*t = > 文本.去空白 s=" x"*
**t = > 文本.去空白 s=" x"**
> 打印 内容=`t`
@@ -17,10 +17,10 @@ title: import official lib (Chinese)
| a |
| b |
*n = > 表.行数 xs=`xs`*
**n = > 表.行数 xs=`xs`**
> 打印 内容=`n`
*row = > 表.取行 xs=`xs` i=0*
**row = > 表.取行 xs=`xs` i=0**
> 打印 内容=`row`
+1 -1
View File
@@ -7,7 +7,7 @@ import utils:utils.mq.md
导入 `utils.mq.md` 后:用返回值绑定,再输出;并直接调用问候。
*y = > utils.加一 n=41*
**y = > utils.加一 n=41**
> print text=`y`
+1 -1
View File
@@ -6,7 +6,7 @@ description: 供 frontmatter > 导入;返回用粗体;副作用用输出函
## 加一
+ `n`
**n + 1**
*n + 1*
## 问候
+ `谁`
+10 -10
View File
@@ -6,23 +6,23 @@ import json:lib/json.mq.md
# Parent
+ `name`
*out = > json.parse text={"role":"parent"}*
*out = > json.set map=`out` key="name" value=`name`*
**out**
**out = > json.parse text={"role":"parent"}**
**out = > json.set map=`out` key="name" value=`name`**
*out*
# Child = > Parent
+ `name`
*self = > Parent name=`name`*
*self = > json.set map=`self` key="role" value="child"*
**self**
**self = > Parent name=`name`**
**self = > json.set map=`self` key="role" value="child"**
*self*
# main
*c = > Child name="Ada"*
*ty = > json.get value=`c` key="_type"*
*role = > json.get value=`c` key="role"*
*name = > json.get value=`c` key="name"*
**c = > Child name="Ada"**
**ty = > json.get value=`c` key="_type"**
**role = > json.get value=`c` key="role"**
**name = > json.get value=`c` key="name"**
> print text=`ty`
> print text=`role`
> print text=`name`
+8 -8
View File
@@ -7,22 +7,22 @@ title: inherit method override
## hello
+ `who`
*msg = "Hello, `who`!"*
**msg**
**msg = "Hello, `who`!"**
*msg*
# Loud = > Greeter
## hello
+ `who`
*msg = "HELLO, `who`!"*
**msg**
**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`
+5 -5
View File
@@ -8,15 +8,15 @@ import json:lib/json.mq.md
## hello
+ `who`
*msg = "Hello, `who`!"*
**msg**
**msg = "Hello, `who`!"**
*msg*
# Loud = > Greeter
# main
*l = > Loud*
*ty = > json.get value=`l` key="_type"*
**l = > Loud**
**ty = > json.get value=`l` key="_type"**
> print text=`ty`
*m = > `l`.hello who="world"*
**m = > `l`.hello who="world"**
> print text=`m`
+2 -2
View File
@@ -6,11 +6,11 @@ title: 循环示例
倒数:
*n = 3*
**n = 3**
- `n` > 0
> print text=`n`
*n = n - 1*
**n = n - 1**
遍历篮子:
+3 -5
View File
@@ -1,12 +1,10 @@
---
title: narrative bold in comment paragraph
description: **强调** mid-line must stay comment, not return syntax
title: narrative without star emphasis
description: v0.3 — do not use * /** for Markdown emphasis; plain prose stays non-executable
---
# main
说明如下
**强调信息**是什么什么
说明如下:强调信息是什么什么(叙述勿写星号强调)。
> print text=ok
+2 -2
View File
@@ -1,11 +1,11 @@
---
title: Hello World
description: Recommended entry — nested fn; print builtin; bold return
description: Nested fn; print builtin; v0.3 italic = return (unused here)
---
# main
打印一句问候。`print` 是函数,不是语法架构;粗体只用于返回值。
打印一句问候。print 是函数,不是语法架构。
> 问候 谁=World
+2 -2
View File
@@ -9,11 +9,11 @@ Nested free function (not an object method) for `helpers.pack.label`.
### label
+ `s`
**s**
*s*
# Box
## tag
+ `s`
**s**
*s*
+2 -2
View File
@@ -5,10 +5,10 @@ import helpers:helpers.mq.md
# main
*v = > helpers.pack.label s="ok"*
**v = > helpers.pack.label s="ok"**
> print text=`v`
*b = > helpers.Box*
**b = > helpers.Box**
> print text=constructed
+1 -1
View File
@@ -6,6 +6,6 @@ import trim_text:text.str_trim
# main
*t = > trim_text s=" hi"*
**t = > trim_text s=" hi"**
> print text=`t`
+20 -20
View File
@@ -6,32 +6,32 @@ import json:lib/json.mq.md
# counter
+ `n`
*t = > json.parse text={"p":"{\"n\":","s":"}"}*
*qn = > str `n`*
*p = > json.get value=`t` key="p"*
*s = > json.get value=`t` key="s"*
*raw = p + qn + s*
**> json.parse text=`raw`**
**t = > json.parse text={"p":"{\"n\":","s":"}"}**
**qn = > str `n`**
**p = > json.get value=`t` key="p"**
**s = > json.get value=`t` key="s"**
**raw = p + qn + s**
*> json.parse text=`raw`*
## bump
*n = > json.get value=`self` key="n"*
*n2 = n + 1*
*t = > json.parse text={"p":"{\"n\":","s":"}"}*
*qn = > str `n2`*
*p = > json.get value=`t` key="p"*
*s = > json.get value=`t` key="s"*
*raw = p + qn + s*
*m = > json.parse text=`raw`*
**m**
**n = > json.get value=`self` key="n"**
**n2 = n + 1**
**t = > json.parse text={"p":"{\"n\":","s":"}"}**
**qn = > str `n2`**
**p = > json.get value=`t` key="p"**
**s = > json.get value=`t` key="s"**
**raw = p + qn + s**
**m = > json.parse text=`raw`**
*m*
# main
*c = > counter n=3*
*ty = > json.get value=`c` key="_type"*
**c = > counter n=3**
**ty = > json.get value=`c` key="_type"**
> print text=`ty`
*n = > json.get value=`c` key="n"*
**n = > json.get value=`c` key="n"**
> print text=`n`
*c2 = > `c`.bump*
*n2 = > json.get value=`c2` key="n"*
**c2 = > `c`.bump**
**n2 = > json.get value=`c2` key="n"**
> print text=`n2`