Add ext/web forms (design §5.5): fields, validate, submit, GET|POST /_form.

Also fix static links (URLs with dots) being misread as db fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-11 17:55:29 +08:00
1 parent 9599303c4c
commit ee019fb1c2
13 files changed
+890 -46

No files matched your search

+14 -12
View File
@@ -1,24 +1,26 @@
# ext/web
Official dynamic website extension. Design: [`doc/design/ext-web.md`](../../doc/design/ext-web.md).
Official dynamic website extension: **GFM tables + class methods**.
Design: [`doc/design/ext-web.md`](../../doc/design/ext-web.md).
| Surface | Import | Classes |
|---------|--------|---------|
| English | `> ext/web/web.mq.md` | `page` · `db` · `app` · `form` · `style` |
| Chinese | `> ext/web/网页.mq.md` | `页面` · `数据库` · `应用` · `表单` · `样式` |
```bash
cargo build -p marqdo_plugin_web
# optional install into ~/.marqdo/ext
marqdo ext add web
```
```markdown
---
> ext/web/web.mq.md
---
Canonical sample (design §4): [`examples/web-site/`](../../examples/web-site/).
# main
> web.ensure_plugin
*`page` = > web.page title=Hi *
*`app` = > web.app page=`page` *
> `app`.listen
```bash
cargo run -- run examples/web-site/index.mq.md
# http://127.0.0.1:18081/ · /admin
```
Scaffold: `> web.scaffold dest=./myapp`
Offline assemble smoke: `tests/ext/web-smoke.mq.md`.
Multipage site pack (compose + table CSS + `/_part`): see [`examples/web-site/`](../../examples/web-site/).
**Form / validate / submit** (§5.5): field table + rules + `mount_form` → `GET|POST /_form/{id}`.