示例概览
仓库的 examples/ 目录包含三个小应用。它们展示同一个思路:一份 Markdown 文件同时是数据源、可查询的数据库和应用的后端。所有数据都是 合成的演示数据。
| 示例 | 展示什么 | 数据文件 |
|---|---|---|
| 项目进度板 | 任务与负责人 JOIN、看板分组、筛选、发布清单 | examples/project-board/project.md |
| 费用报告 | 显式类型的金额与布尔、预算对象、分类汇总、报销筛选 | examples/expense-report/expenses.md |
| 检索回归实验室 | 有限动作的写回应用:预览差异、原子保存、签核与发布门槛 | examples/retrieval-lab/evaluation.md |
运行全部示例
需要克隆仓库,在 macOS/Linux 上用 Python 3.10+ 运行:
sh
git clone https://github.com/Peiiii/mddb.git
cd mddb
python3 examples/serve.py| 地址 | 内容 |
|---|---|
http://127.0.0.1:8768/examples | 示例目录页 |
http://127.0.0.1:8769 | 检索回归实验室 |
http://127.0.0.1:8770 | 项目进度板 |
http://127.0.0.1:8771 | 费用报告 |
http://127.0.0.1:8772 | 通用工作空间(带示例文档) |
这个开发启动器会把示例数据复制到仓库中被 Git 忽略的 .local/ 目录再运行,不会修改仓库中的示例文件。所有服务都只监听本机回环地址。
不克隆仓库
只安装了 MDDB 的用户,可以直接打开带示例文档的工作空间:
sh
mddb workspace --directory ./notes --seed也可以把下面各页中的数据文件内容保存为本地 .md 文件,直接用 mddb query 体验查询。
仓库说明原文
以下内容引用自 examples/README.md:
All data is synthetic.
project-board/: join tasks and owners, filter a project board.expense-report/: typed amounts, reimbursement state, category totals.retrieval-lab/: preview and save a simulated evaluation result. Scores are fixtures.
From the repository root, run python3 examples/serve.py. The workspace is on port 8772, the example directory at http://127.0.0.1:8768/examples, and the three examples on ports 8769–8771. This development launcher copies sample data into the ignored .local/ directory and never changes the fixtures. Installed users can run mddb workspace --directory ./notes --seed without cloning the repository.