Treat --- as Markdown HR everywhere, end side-effect helpers with empty returns, and accept soft emphasis, float literals, and dynamic footnote keys so LLM-friendly .mq.md stays runnable. Ship the weekend coffee example plus gold fixtures. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
829 B
Markdown
22 lines
829 B
Markdown
# 代码即文档 · 周末咖啡手账
|
||
|
||
可读可跑的 v0.3 样例:`.mq.md` 同时是说明文和程序。
|
||
|
||
```bash
|
||
marqdo run examples/code-as-docs/index.mq.md
|
||
```
|
||
|
||
## 这份样例在示范什么
|
||
|
||
| 习惯 | 写法 |
|
||
|------|------|
|
||
| 数据给人读 | GFM 表当菜单 / 订单 |
|
||
| 步骤嵌在句子里 | `**总额 = 价 * 杯数**`、返回 `*总额*` |
|
||
| 装饰性强调 | `**说明**` 不执行(见设计 G2) |
|
||
| 段落分隔 | 顶层或体内的 `---` 只是分割线 |
|
||
| 浮点 | `折扣`=0.85 |
|
||
| 动态键 | `` 菜单[^`名`] `` |
|
||
| 调用 | 粗体赋值右侧 **可省略 `>`**:`**摘要 = 结账摘要 …**`;输出可用 `**打印 内容=…**` |
|
||
|
||
相关设计:[code-as-docs-gaps.md](../../doc/design/code-as-docs-gaps.md)、[markdown-mapping-v0.3.md](../../doc/design/markdown-mapping-v0.3.md) §6。
|