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

+18 -13
View File
@@ -1,19 +1,24 @@
# examples/web-net-site
# web-net-site
Demonstrates the network-extended `ext/web` + `lib/net` surface (design `doc/design/ext-web-net.md`).
本工程保留文章列表、关于页、文章表单、Cookie/Multipart 工具页、登录后的原生管理后台,以及 /live WebSocket 回显。页面递归组合到 Markdown 和原生控件;浏览器交互由 public/client.mq.md 表达。
```bash
cargo build -p marqdo_plugin_web
cargo run -- examples/web-net-site/index.mq.md
从仓库根目录准备当前 CLI 与工程插件后,使用同一份开发手册构建 Web 和浏览器运行时:
```sh
target/debug/marqdo call skills/marqdo-dev/index.mq.md prepare_engineering --effects process.exec --fs-root . --require-ok --json
target/debug/marqdo call skills/marqdo-dev/index.mq.md prepare_web --effects plugin --fs-root . --require-ok --json
target/debug/marqdo call skills/marqdo-dev/index.mq.md build_browser 'out="examples/web-net-site/public/generated"' --effects plugin,process.exec,fs.write --fs-root . --require-ok --json
target/debug/marqdo call examples/web-net-site/index.mq.md serve --effects plugin,fs.write,network.write --fs-root examples/web-net-site --require-ok --json
```
Then open http://127.0.0.1:18083/:
打开 http://127.0.0.1:18083。默认数据库位于站点文件根的 data/site-net.db,重启保留已有文章。缺少兼容 WASM 目标时,先按 [工具链任务](../../skills/marqdo-dev/toolchain.mq.md) 准备工作区编译器,再把返回的 compiler 传给 build_browser。
- `/` — articles from SQLite plus a live WebSocket widget (`/live`, served by `public/live.js`)
- `/about`
- `/new` — form POST to `/_form/article`
- `/tools` — parsing demos powered by `lib/net`: `net.cookie_parse` and `net.multipart_parse`
- `/admin` — session-gated admin; sign in with `admin` / `secret`
- `/live` — WebSocket echo endpoint (try it from the home widget, or with `web.ws.connect`)
- [布局入口](components/index.mq.md) 组合导航、侧栏、主体和页脚,叶子在 components/content。
- [文章表单](forms.mq.md) 统一定义字段与服务端规则;校验失败后保留真实 CSRF,成功回到文章列表。
- [工具页](pages/tools.mq.md) 展示真实网络解析结果,不请求远端服务。
- [客户端](public/client.mq.md) 保留按钮与 Enter 发送、去除首尾空白、忽略空输入及连续回显日志。
- 管理后台登录使用本机演示账号 admin / secret。部署时替换账号与访问策略。
You may run it from the repo root or from this directory: relative `static_dir` (e.g. `public`) and relative db paths (e.g. `data/site-net.db`) resolve against the **entry script's directory**, not the terminal's current working directory.
请求资源沿用五列 View;数据库查询随每次请求更新,表单引用解析当前会话。详情见 [请求资源设计](../../doc/design/web-view-resources.md)。
开发入口的 test_browser 使用实际当前 WASM 验证回显、表单重试、新增文章、后台登录与窄屏布局。HTTP 回归 web_handbook 在 Tree 与 Bytecode 两个后端启动临时站点,验证数据和鉴权,避免操作用户数据库。