Files
marqdo/examples/web-net-site/index.mq.md
T
cflmy 9331af78e2 release(2.8.0): 合入 CHANGELOG/README/发版说明/skills prove 任务;CI 链接指向 doc/releases
- CHANGELOG.md:v2.8.0 条目(中英双语);
- README.md:版本行 2.7.1→2.8.0 + 愿景第 6 条(知识可证明);
- doc/releases/v2.8.0.md:双语发版说明(亮点/用法/已知限制);
- skills/marqdo-dev/index.mq.md:新增 prove 任务(路径/目录模式/
  require_lean/json;参数用 + 行声明升参,check 与 narrative-ratio 通过);
- 设计文档 §12.5 标记已合入;发版链接统一指向 doc/releases/v2.8.0.md。
2026-11-18 10:29:26 +08:00

4.4 KiB
Executable File

markup, type, view, route, title, import
markup type view route title import
occlusion web main / Marqdo Net Site
layout home database forms styles web form admin auth socket fs result
components/index.mq.md components/home.mq.md db/index.mq.md forms.mq.md styles/shell.mq.md ext/web/web.mq.md ext/data/form.mq.md ext/data/admin.mq.md ext/security/auth.mq.md ext/net/websocket.mq.md lib/fs.mq.md lib/result.mq.md

Read this entry, then the layout index, content leaves, database entry, form resource and browser client. Home, About, Publish and Tools are declared Documents. Native administration remains enabled and login-gated. The /live socket is a separate network resource. No page uses the removed compose APIs or a raw HTML shell.

main

返回 类型 说明
result list Shared recursive frame around introduction, echo controls and current articles

This startup function describes structure, reading only the terminal Markdown leaves. The database query remains a typed resource resolved per request, while the client uses native controls and the official bridge. Rendering the page cannot initialize or clear business records. Follow each component import to edit one responsibility instead of reproducing the complete page.

We body = Assemble the three independent home responsibilities. Return Place them in the shared recursive site frame.

serve

参数 类型 默认 说明
root text "examples/web-net-site" Explicit discovery directory relative to the checkout
port number 18083 Local demonstration listen port
url any None None chooses the site-root SQLite file; tests use an owned temporary URI
返回 类型 说明
result map Blocking listener with retained article data, forms, authentication and echo

Use root="examples/web-net-site", port=18083 and url=None from the checkout, with --fs-root examples/web-net-site and plugin,fs.write,network.write. Build current browser assets into public/generated through the development handbook first. Missing runtime assets stop before listening rather than leaving the widget apparently ready.

Initialization preserves existing articles and seeds only an empty table. Theme compilation uses the original property declarations and writes only the explicit generated stylesheet. Discovery assembles the readable Documents, then the workflow enables native administration, attaches local fixture credentials, mounts the public article form and binds anonymous loopback echo. Real deployment must replace fixture credentials and its network policy. Keep each returned app before listening.

assets =

file
public/generated/marqdo_wasm.wasm
public/generated/marqdo-bridge.js

users =

@ username password role
1 admin secret admin

We app = [Attach actual login sessions and the native admin gate](auth.attach(app=app, users=users, login_path="/admin/login", login_redirect="/admin", logout_redirect="/")) and article = Build the shared validation resource and app = [Mount the public creation form explicitly](form.mount(app=app, id="article", form=article)). We app = [Bind the original local WebSocket echo route](socket.route(app=app, path="/live", mode="echo", require_auth=False)). Return Listen only after data, resources and policy are ready.