Release 2.7.0: executable handbooks and native user-site workflows

This commit is contained in:
cflmy committed 2026-11-10 17:03:06 +08:00
1 parent aa0c4d0f55
commit d9aef957f7
562 files changed
+21064 -20387

No files matched your search

+11 -7
View File
@@ -6,19 +6,23 @@ description: True / False / None and and / or / not
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
Keywords: `True`, `False`, `None`, and `and` / `or` / `not`.
**`a` = True**
**`b` = False**
We first **a = True** for the next step.
We first **b = False** for the next step.
1. `a` and not `b`
> print text=ok
We now **[Display this step's result](> print text="ok")**.
2. *
> print text=fail
We now **[Display this step's result](> print text="fail")**.
**`probe` = 1**
We first **probe = 1** for the next step.
1. None
> print text=none-truthy
We now **[Display this step's result](> print text="none-truthy")**.
2. *
> print text=none-falsy
We now **[Display this step's result](> print text="none-falsy")**.
+6 -2
View File
@@ -7,8 +7,12 @@ stdin: Ada
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
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: "**
We first **name = [Compute name](input(prompt="Name: "))** for the next step.
> print text=Hello `name`!
We now **[Display this step's result](> print text="Hello `name`!")**.
+6 -2
View File
@@ -6,10 +6,14 @@ description: Named and positional forms
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
The `print` builtin accepts named or positional arguments:
> print text=named form
We now **[Display this step's result](> print text="named form")**.
> print positional
We now **[Display this step's result](> print "positional")**.
Named args may contain spaces; positional args may not.
+16 -12
View File
@@ -6,30 +6,34 @@ description: Host builtins for strings and tables
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
Length and type:
**`s` = "hello"**
We first **s = "hello"** for the next step.
**`n` = > len `s`**
We first **n = [Compute n](len(`s`))** for the next step.
> print text=`n`
We now **[Display this step's result](> print text=`n`)**.
**`ty` = > type `s`**
We first **ty = [Compute ty](type(`s`))** for the next step.
> print text=`ty`
We now **[Display this step's result](> print text=`ty`)**.
Trim, split, join, and index:
**`t` = > trim value=" hi "**
We first **t = [Compute t](trim(value=" hi "))** for the next step.
**`parts` = > split value="a,b" sep=","**
We first **parts = [Compute parts](split(value="a,b", sep=","))** for the next step.
**`mid` = > at value=`parts` index=0**
We first **mid = [Compute mid](at(value=`parts`, index=0))** for the next step.
**`j` = > join value=`parts` sep="-"**
We first **j = [Compute j](join(value=`parts`, sep="-"))** for the next step.
> print text=`t`
We now **[Display this step's result](> print text=`t`)**.
> print text=`mid`
We now **[Display this step's result](> print text=`mid`)**.
> print text=`j`
We now **[Display this step's result](> print text=`j`)**.
+8 -4
View File
@@ -6,12 +6,16 @@ description: 无需导入:打印、长度、文本、整数 与 print / len /
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | 空值;按顺序执行本页的演示步骤,观察输出或已说明的副作用。 |
内核中英别名等价,可混用:
**`s` = "你好"**
我们先**s = "你好"**,供下一步使用。
**`n` = > 长度 值=`s`**
我们先**n = [计算并保存 n](长度(值=`s`))**,供下一步使用。
> 打印 内容=`n`
随后我们**[显示当前步骤的结果](> 打印 内容=`n`)**。
> print text=also-english
随后我们**[显示当前步骤的结果](> print text="also-english")**。
+11 -7
View File
@@ -6,19 +6,23 @@ description: 真 / 假 / 空 与 且 / 或 / 非
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | 空值;按顺序执行本页的演示步骤,观察输出或已说明的副作用。 |
关键字:`真`、`假`、`空`,以及 `且` / `或` / `非`。
**`a` = 真**
**`b` = 假**
我们先**a = True**,供下一步使用。
我们先**b = False**,供下一步使用。
1. `a` 且 非 `b`
> 打印 内容=通过
随后我们**[显示当前步骤的结果](> 打印 内容="通过")**。
2. *
> 打印 内容=失败
随后我们**[显示当前步骤的结果](> 打印 内容="失败")**。
**`probe` = 1**
我们先**probe = 1**,供下一步使用。
1. 空
> 打印 内容=空为真
随后我们**[显示当前步骤的结果](> 打印 内容="空为真")**。
2. *
> 打印 内容=空为假
随后我们**[显示当前步骤的结果](> 打印 内容="空为假")**。
+6 -2
View File
@@ -6,10 +6,14 @@ description: 具名与位置两种写法
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | 空值;按顺序执行本页的演示步骤,观察输出或已说明的副作用。 |
内置 `打印` 接受具名或位置实参:
> 打印 内容=具名写法
随后我们**[显示当前步骤的结果](> 打印 内容="具名写法")**。
> 打印 位置写法
随后我们**[显示当前步骤的结果](> 打印 "位置写法")**。
具名实参可以带空格;位置实参不可以。
+16 -12
View File
@@ -6,30 +6,34 @@ description: 主机内置;中文别名覆盖常用几个
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | 空值;按顺序执行本页的演示步骤,观察输出或已说明的副作用。 |
长度与英文 `type`(类型无中文内核别名,见标准库文档):
**`s` = "你好"**
我们先**s = "你好"**,供下一步使用。
**`n` = > 长度 值=`s`**
我们先**n = [计算并保存 n](长度(值=`s`))**,供下一步使用。
> 打印 内容=`n`
随后我们**[显示当前步骤的结果](> 打印 内容=`n`)**。
**`ty` = > type `s`**
我们先**ty = [计算并保存 ty](type(`s`))**,供下一步使用。
> 打印 内容=`ty`
随后我们**[显示当前步骤的结果](> 打印 内容=`ty`)**。
去空白、拆分、拼接、按下标(主机名仍为英文):
**`t` = > trim value=" 嗨 "**
我们先**t = [计算并保存 t](trim(value=" 嗨 "))**,供下一步使用。
**`parts` = > split value="甲,乙" sep=","**
我们先**parts = [计算并保存 parts](split(value="甲,乙", sep=","))**,供下一步使用。
**`mid` = > at value=`parts` index=0**
我们先**mid = [计算并保存 mid](at(value=`parts`, index=0))**,供下一步使用。
**`j` = > join value=`parts` sep="-"**
我们先**j = [计算并保存 j](join(value=`parts`, sep="-"))**,供下一步使用。
> 打印 内容=`t`
随后我们**[显示当前步骤的结果](> 打印 内容=`t`)**。
> 打印 内容=`mid`
随后我们**[显示当前步骤的结果](> 打印 内容=`mid`)**。
> 打印 内容=`j`
随后我们**[显示当前步骤的结果](> 打印 内容=`j`)**。
+6 -2
View File
@@ -7,8 +7,12 @@ description: 从 stdin 读一行;可选提示。演示数据写在 frontmatter
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | 空值;按顺序执行本页的演示步骤,观察输出或已说明的副作用。 |
内置「输入」读一行。演示与 marqdo view / 静态导出可在 frontmatter 写「输入:」(或 stdin:)。CLI 也可用管道或 --stdin-file。Live view 可用 Preset input 覆盖。
**`名字` = > 输入 提示="名字:"**
我们先**名字 = [计算并保存 名字](输入(提示="名字:"))**,供下一步使用。
> 打印 内容=你好 `名字`!
随后我们**[显示当前步骤的结果](> 打印 内容="你好 `名字`!")**。