Consolidate layout: tests fixtures, public user docs, and view site.

Move gold samples under tests/, put executable user docs in public/, restyle view, and add catalog plus gh-pages publish workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-04 14:49:44 +08:00
1 parent 29418e14f2
commit 96a7c6ce76
65 files changed
+1770 -432

No files matched your search

-15
View File
@@ -1,15 +0,0 @@
# Marqdo examples(金样例)
本目录即测试夹具,见 [doc/design/examples-and-tests.md](../doc/design/examples-and-tests.md)。
| 目录 | 内容 |
|------|------|
| [`structure/`](structure/) | 函数、调用、分支、循环、表、导入、位置实参 |
| [`keywords/`](keywords/) | `print`、布尔与 `and`/`or`/`not` |
| [`errors/`](errors/) | 期望失败(未定义名 / 未知函数 / 实参 / 语法) |
```bash
cargo test
marqdo run examples/structure/hello.mq.md
marqdo view examples
```
View File
Whitespace-only changes.
-12
View File
@@ -1,12 +0,0 @@
---
title: bad arity
---
# main
> needs_one
## needs_one
- x
> print text=`x`
-7
View File
@@ -1,7 +0,0 @@
---
title: unrecognized code line
---
# main
~not-valid-syntax
-7
View File
@@ -1,7 +0,0 @@
---
title: undefined variable
---
# main
> print text=`missing`
-7
View File
@@ -1,7 +0,0 @@
---
title: unknown function
---
# main
> no_such_fn x=1
-20
View File
@@ -1,20 +0,0 @@
---
title: 布尔与逻辑关键字
---
# main
*`a` = True*
*`b` = False*
+ `a` and not `b`
> print text=ok
+ *
> print text=fail
*`probe` = 1*
+ None
> print text=none-truthy
+ *
> print text=none-falsy
-9
View File
@@ -1,9 +0,0 @@
---
title: 内置 print
---
# main
> print text=named form
> print positional
-14
View File
@@ -1,14 +0,0 @@
---
title: 分支示例
---
# main
*`x` = 0*
+ `x` > 0
> print text=正数
+ `x` < 0
> print text=负数
+ *
> print text=零
-16
View File
@@ -1,16 +0,0 @@
---
title: 集合(表格)示例
---
# main
`篮子` =
| 果 |
|----|
| 苹果 |
| 梨 |
| 桃 |
- [果](篮子)
> print text=`果`
-5
View File
@@ -1,5 +0,0 @@
# Hello World
本程序调用内置函数 `print` 打印问候。注释里的 **粗体** 与 *斜体* 都不执行。
> print text=Hello World!
-14
View File
@@ -1,14 +0,0 @@
---
title: 跨文件导入示例
> utils.mq.md
---
# main
导入 `utils.mq.md` 后:用返回值绑定,再输出;并直接调用问候。
*`y` = > 加一 n=41*
> print text=`y`
> 问候 谁=Marqdo
-14
View File
@@ -1,14 +0,0 @@
---
title: 工具函数
description: 供 frontmatter > 导入;返回用粗体;副作用用输出函数
---
# 加一
- n
**`n` + 1**
# 问候
- 谁
> print text=你好,`谁`!
-25
View File
@@ -1,25 +0,0 @@
---
title: 循环示例
---
# main
倒数:
*`n` = 3*
- `n` > 0
> print text=`n`
*`n` = `n` - 1*
遍历篮子:
`篮子` =
| 果 |
|----|
| 苹果 |
| 梨 |
- [果](篮子)
> print text=今天吃`果`
-15
View File
@@ -1,15 +0,0 @@
---
title: Hello World
description: Recommended entry — nested fn; print builtin; bold return
---
# main
打印一句问候。`print` 是函数,不是语法架构;粗体只用于返回值。
> 问候 谁=World
## 问候
- 谁
> print text=Hello `谁`!
-19
View File
@@ -1,19 +0,0 @@
---
title: 位置实参
description: `> fn value` binds by parameter order; named form still works
---
# main
位置实参:
> 问候 Marqdo
具名实参(保留):
> 问候 谁=World
## 问候
- 谁
> print text=Hello `谁`!