This commit is contained in:
cflmy committed 2026-11-18 10:51:28 +00:00
commit a4c04666b4
217 files changed
+506293

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
---
markup: occlusion
title: Cross-file import
description: Frontmatter nested import: map
import:
utils: utils.mq.md
---
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
In the YAML header, nested `import:` with `utils: utils.mq.md` imports a sibling module and binds the library name `utils`.
Bind a return value, print it, then call greet:
We first **y = [Compute y](utils.add_one(n=41))** for the next step.
We now **[Display this step's result](> print text=`y`)**.
We now **[Call utils.greet](> utils.greet who="Marqdo")**.
+33
View File
@@ -0,0 +1,33 @@
---
markup: occlusion
title: Utility module
description: Imported by main; italic is return; print for side effects
---
## add_one
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| n | any | required | Numeric input advanced or calculated by this example |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | The value explicitly returned below; conditional returns follow the selected branch |
Input `n`, used by the steps below.
After these steps, return *(`n` + 1)*.
## greet
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| who | any | required | Recipient name inserted into the greeting |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | None; this function performs the described effects instead of returning business data |
Input `who`, used by the steps below.
We now **[Display this step's result](> print text="Hello, `who`!")**.
After these steps, return *None*.
+23
View File
@@ -0,0 +1,23 @@
---
markup: occlusion
title: 跨文件导入
description: frontmatter 导入 bind:路径.mq.md
导入:
工具: 工具.mq.md
---
# main
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | 空值;按顺序执行本页的演示步骤,观察输出或已说明的副作用。 |
在 YAML 头里写 `导入 工具:工具.mq.md` 可导入同级模块并绑定库名「工具」。
绑定返回值、打印,再调用问候:
我们先**y = [计算并保存 y](工具.加一(n=41))**,供下一步使用。
随后我们**[显示当前步骤的结果](> 打印 内容=`y`)**。
随后我们**[执行 工具.问候](> 工具.问候 谁="Marqdo")**。
+33
View File
@@ -0,0 +1,33 @@
---
markup: occlusion
title: 工具模块
description: 被 main 导入;斜体为返回;副作用用打印
---
## 加一
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| n | any | 必填 | Numeric input advanced or calculated by this example |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | 下文显式返回的计算值或结构化结果;分支存在时遵循实际命中的分支。 |
输入`n`,按下方步骤使用这个值。
完成上述步骤后,返回*(`n` + 1)*。
## 问候
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| 谁 | any | 必填 | 要显示在问候中的称呼 |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | 空值;本函数通过上述操作产生效果,不返回业务数据。 |
输入`谁`,按下方步骤使用这个值。
随后我们**[显示当前步骤的结果](> 打印 内容="你好,`谁`!")**。
完成上述步骤后,返回*None*。