Release 2.7.0: executable handbooks and native user-site workflows
This commit is contained in:
1 parent
aa0c4d0f55
commit
d9aef957f7
562 files changed
+21064
-20387
No files matched your search
@@ -1,19 +1,24 @@
|
||||
# examples/web-net-site-zh
|
||||
# web-net-site-zh
|
||||
|
||||
中文作者面示例:只导入 `ext/web/网页.mq.md`(不用英文 `web.mq.md`),并用 `lib/网络.mq.md` 的解析原语。
|
||||
本工程保留文章列表、关于页、文章表单、Cookie/Multipart 工具页、登录后的原生管理后台,以及 /live WebSocket 回显。中文作者使用网页、表单、后台、鉴权和实时资源入口。页面递归组合到 Markdown 和原生控件;浏览器交互由 public/client.mq.md 表达,旧 public/live.js 已被实际验证后的 Marqdo 客户端替代。
|
||||
|
||||
```bash
|
||||
cargo build -p marqdo_plugin_web
|
||||
cargo run -- examples/web-net-site-zh/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-zh/public/generated"' --effects plugin,process.exec,fs.write --fs-root . --require-ok --json
|
||||
target/debug/marqdo call examples/web-net-site-zh/index.mq.md serve --effects plugin,fs.write,network.write --fs-root examples/web-net-site-zh --require-ok --json
|
||||
```
|
||||
|
||||
从仓库根目录或示例目录运行都可以:`static_dir`(如 `public`)与相对 db 路径(如 `data/site-net-zh.db`)都会基于**入口脚本所在目录**解析,而不是终端的当前目录。
|
||||
打开 http://127.0.0.1:18084。默认数据库位于站点文件根的 data/site-net-zh.db,重启保留已有文章。缺少兼容 WASM 目标时,先按 [工具链任务](../../skills/marqdo-dev/toolchain.mq.md) 准备工作区编译器,再把返回的 compiler 传给 build_browser。
|
||||
|
||||
打开 http://127.0.0.1:18084/:
|
||||
- [布局入口](components/index.mq.md) 组合导航、侧栏、主体和页脚,叶子在 components/content。
|
||||
- [文章表单](forms.mq.md) 统一定义字段与服务端规则;校验失败后保留真实 CSRF,成功回到文章列表。
|
||||
- [工具页](pages/tools.mq.md) 展示真实网络解析结果,不请求远端服务。
|
||||
- [客户端](public/client.mq.md) 保留按钮与 Enter 发送、去除首尾空白、忽略空输入及连续回显日志。
|
||||
- 管理后台登录使用本机演示账号 admin / secret。部署时替换账号与访问策略。
|
||||
|
||||
- `/` — SQLite 文章列表 + `/live` WebSocket 实时小部件(`public/live.js`)
|
||||
- `/about`
|
||||
- `/new` — 表单 POST 到 `/_form/article`
|
||||
- `/tools` — `lib/net`(`解析Cookie` / `解析多部分`)的解析演示
|
||||
- `/admin` — 会话门禁后台,用 `admin` / `secret` 登录
|
||||
- `/live` — WebSocket 回显端点(首页小部件或 `网页.实时` 的 `连接` 接入)
|
||||
请求资源沿用五列 View;数据库查询随每次请求更新,表单引用解析当前会话。详情见 [请求资源设计](../../doc/design/web-view-resources.md)。
|
||||
|
||||
开发入口的 test_browser 使用实际当前 WASM 验证回显、表单重试、新增文章、后台登录与窄屏布局。HTTP 回归 web_handbook 在 Tree 与 Bytecode 两个后端启动临时站点,验证数据和鉴权,避免操作用户数据库。
|
||||
Reference in new issue
Block a user