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
@@ -0,0 +1,32 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Current article list and slug detail
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
query: ext/data/view.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
Both views read the same application-owned articles table for each request. Cards use summaries and slug links; detail uses the complete Markdown body. These pure descriptors do not open a second database or cache startup records. Their renderer retains the native card/article classes consumed by the original theme.
|
||||
|
||||
## cards
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Current article cards linked to /post/slug |
|
||||
|
||||
Construct this query without effects. The serving application owns its database resource and actual request execution. Cards keep the original stable id order and use the existing summary/title/slug projection. Titles and summaries are escaped text, while the full body is intentionally reserved for detail. A publish through either mounted form becomes visible on the next request.
|
||||
|
||||
We **resource = [Describe the actual current article list](query.query(source="articles", order="id", link_prefix="/post/"))**.
|
||||
Return *[Place one request-time card responsibility](component.resource(value=`resource`, slot="articles"))*.
|
||||
|
||||
## detail
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | First article matching the actual captured slug, rendered with full Markdown body |
|
||||
|
||||
The declared /post/{slug} Document supplies the path parameter when the server resolves this query. A same-named query-string value cannot override that capture. The native renderer uses the body even when a summary is present, and it does not mutate the retained condition between requests. Missing database resources remain errors; a missing record remains an empty result under the existing query contract.
|
||||
|
||||
We **condition = [Keep a native record rather than a one-column list](table.put(in=None, at="slug", value="{slug}"))** and **resource = [Describe full-body slug detail](query.query(source="articles", where=`condition`, detail=True, limit=1))**.
|
||||
Return *[Place the actual requested article](component.resource(value=`resource`, slot="article"))*.
|
||||
@@ -0,0 +1,9 @@
|
||||
> about
|
||||
|
||||
# About
|
||||
|
||||
Documentation and the deployed site stay one .mq.md artifact. Layout and theme are GFM style tables in styles/shell.mq.md — structure without hand-written CSS or business JavaScript.
|
||||
|
||||
- docs = program
|
||||
- server-side rules
|
||||
- hands-on
|
||||
@@ -0,0 +1 @@
|
||||
[Site](/) · [Admin](/admin) · [Logout](/admin/logout)
|
||||
@@ -0,0 +1,9 @@
|
||||
> desk · you are in admin
|
||||
|
||||
# Admin
|
||||
|
||||
This is the management desk (login required): same articles schema as the public site, assembled as list + create form — not a separate SPA. Use Site in the topnav to return, or Logout to end the session.
|
||||
|
||||
- login-gated
|
||||
- table-declared
|
||||
- create + list
|
||||
@@ -0,0 +1 @@
|
||||
[Marqdo](https://www.marqdo.com/) · [Source](https://github.com/cflmy/marqdo)
|
||||
@@ -0,0 +1,13 @@
|
||||
> WWW demo · tables as the full stack
|
||||
|
||||
# Marqdo
|
||||
|
||||
One executable Markdown artifact declares routes, forms, admin pages, and styles — no hand-written business JavaScript, no author .css. Click a card for the full article, then try the three steps below.
|
||||
|
||||
- 0 author JS
|
||||
- 0 author .css
|
||||
- GFM tables
|
||||
|
||||
1. Click any card — /post/{slug} opens the detail page from the same articles table.
|
||||
2. Open [New](/new) and submit with an empty title (validation from a rule table).
|
||||
3. Open top-nav **Login** (admin / demo), then **Admin** — gated desk with create form + list.
|
||||
@@ -0,0 +1,5 @@
|
||||
> form · try validation
|
||||
|
||||
# New article
|
||||
|
||||
Leave Title empty and submit — the error comes from the rule table, not client JavaScript. Then fill title, slug, and summary to create a row shared with Admin and the card grid.
|
||||
@@ -0,0 +1 @@
|
||||
> article · table-bound detail
|
||||
@@ -1,30 +1,40 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: components/desk
|
||||
description: Admin desk chrome — brand reads Admin; no public side rail.
|
||||
title: Administration navigation and footer
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
fs: lib/fs.mq.md
|
||||
---
|
||||
|
||||
The custom desk keeps its own brand and closing links, and omits the public side rail. Authentication remains the serving entry's responsibility. Neither constructing these nodes nor hiding their links can authorize a visitor to the administration route.
|
||||
|
||||
## nav
|
||||
|
||||
`nav` =
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Desk navigation using the real current session |
|
||||
|
||||
| front | back | style | media | when |
|
||||
|-------|------|-------|-------|------|
|
||||
| Admin | /admin | | | |
|
||||
| Site | / | | | |
|
||||
| New | /new | | | |
|
||||
| Logout | /admin/logout | | | auth |
|
||||
Construction needs no effects. The first link preserves Admin as the operator's current context, followed by Site, New and Logout. Only the logout link is conditional, matching the original navigation. The entire desk is separately gated, and the actual logout destination remains a native session route. Returned nodes keep their structured resource value so the parent can place them without HTML strings.
|
||||
|
||||
*`nav`*
|
||||
`items` =
|
||||
|
||||
| @ | label | href | when |
|
||||
|---|---|---|---|
|
||||
| 1 | Admin | /admin | |
|
||||
| 2 | Site | / | |
|
||||
| 3 | New | /new | |
|
||||
| 4 | Logout | /admin/logout | auth |
|
||||
|
||||
We **resource = [Describe the desk's current navigation](component.navigation(items=`items`))**.
|
||||
Return *[Keep the same navigation fragment slot](component.resource(value=`resource`, slot="nav"))*.
|
||||
|
||||
## foot
|
||||
|
||||
`foot` =
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Desk footer with terminal Markdown return and logout links |
|
||||
|
||||
| front | back | style |
|
||||
|-------|------|-------|
|
||||
| Site | / | |
|
||||
| Admin | /admin | |
|
||||
| Logout | /admin/logout | |
|
||||
Read this leaf with fs.read under the site root. The route gate has already decided access before the renderer resolves this component. Site and Admin retain their return destinations, while Logout ends the session only when followed. The footer has one content responsibility and no internal layout to split further; the parent owns its placement and the original theme owns its appearance.
|
||||
|
||||
*`foot`*
|
||||
We **text = [Read the desk's terminal closing links](fs.read_text(path="components/content/desk-footer.md"))** and **leaf = [Retain ordinary Markdown content](component.markdown(text=`text`, slot="footer-content"))**.
|
||||
Return *[Place it in the semantic desk footer](component.wrap(children=`leaf`, kind="footer", slot="footer", style="foot"))*.
|
||||
@@ -1,15 +1,21 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Public footer Markdown leaf
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
fs: lib/fs.mq.md
|
||||
---
|
||||
|
||||
The public footer is one simple set of project and source links. It has no independent internal columns, so its terminal Markdown is the stopping point for decomposition. The parent controls where it appears; the theme supplies its existing footer appearance.
|
||||
|
||||
## foot
|
||||
|
||||
`foot` =
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Semantic footer containing its terminal Markdown links |
|
||||
|
||||
| front | back | style |
|
||||
|-------|------|-------|
|
||||
| Marqdo | https://www.marqdo.com/ | |
|
||||
| Source | https://github.com/cflmy/marqdo | |
|
||||
Read with fs.read relative to the granted site root. The leaf retains the original project and source destinations; it does not query business rows or expose session credentials. Changing wording belongs in content/footer.md, while changing layout belongs in the parent. This module never renders a child to HTML before composition.
|
||||
|
||||
*`foot`*
|
||||
We **text = [Read the terminal project links](fs.read_text(path="components/content/footer.md"))** and **leaf = [Keep the links in Markdown](component.markdown(text=`text`, slot="footer-content"))**.
|
||||
Return *[Preserve the footer's semantic region](component.wrap(children=`leaf`, kind="footer", slot="footer", style="foot"))*.
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: SEO, font and theme resource declarations
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
head: ext/web/head.mq.md
|
||||
---
|
||||
|
||||
This leaf preserves the original site metadata and Google Fonts resource addresses. It declares links, never fetches them during assembly. Theme CSS is explicitly generated from style tables by serve and mounted at the declared static path.
|
||||
|
||||
## nodes
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| homepage | bool | False | Include the original home-only SEO rows |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Pure head resource for real SEO, fonts and the generated theme |
|
||||
|
||||
Use `homepage`=False without effects during page assembly. Only the home Document opts into its original SEO rows; fonts and the theme remain shared. Metadata remains key/value records and the links retain native rel/href/crossorigin fields. The renderer collects them into the actual head in both preview and HTTP output, deduplicating equal declarations. They do not become body placeholders or fragment markup.
|
||||
|
||||
Font delivery still depends on browser access to the external font service; the page uses its declared fallbacks when unavailable. Declaring the theme path does not build it or prove it exists. The serving workflow compiles and writes that exact file before opening a listener, while a static preview caller owns asset preparation.
|
||||
|
||||
`meta` =
|
||||
|
||||
| @ | key | value |
|
||||
|---|---|---|
|
||||
| 1 | description | Tables as the full stack — Marqdo Web demo with zero author business JavaScript. |
|
||||
| 2 | og:type | website |
|
||||
| 3 | og:title | Marqdo Web Site |
|
||||
|
||||
`links` =
|
||||
|
||||
| @ | rel | href | crossorigin |
|
||||
|---|---|---|---|
|
||||
| 1 | preconnect | https://fonts.googleapis.com | |
|
||||
| 2 | preconnect | https://fonts.gstatic.com | anonymous |
|
||||
| 3 | stylesheet | https://fonts.googleapis.com/css2?family=Great+Vibes&family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@400;600&display=swap | |
|
||||
| 4 | stylesheet | /static/generated/theme.css | |
|
||||
|
||||
We **selected_meta = None** because non-home pages retain only their originally shared head links.
|
||||
1. `homepage`
|
||||
We **selected_meta = meta** to retain the original home-specific SEO.
|
||||
We **resource = [Retain actual metadata and native head links](head.resource(meta=`selected_meta`, links=`links`))**.
|
||||
Return *[Place one pure head resource alongside the layout](component.resource(value=`resource`, slot="document-head"))*.
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Public and desk layout entry
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
nav: nav.mq.md
|
||||
side: side.mq.md
|
||||
foot: foot.mq.md
|
||||
desk: desk.mq.md
|
||||
head: head.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
This parent declares one site frame. The public tree has navigation, side/main and footer; the desk has its own navigation and footer with no public rail. Children own Markdown or typed request resources. Geometry is declared here and compiled from the original theme tables, never hidden inside a rendered HTML string.
|
||||
|
||||
## frame
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| body | list | required | Page-owned main nodes, retaining nested resources |
|
||||
| management | bool | False | Select the gated custom desk frame without a public side rail |
|
||||
| homepage | bool | False | Keep original home SEO scoped to Home |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Recursive site structure and pure head resources |
|
||||
|
||||
Use `body`, `management`=False and `homepage`=False. Child navigation keeps its actual session conditions; this function does not authenticate or authorize a visitor. The desk route is separately gated in serve, so choosing its frame cannot grant access. Footer content is already a simple Markdown responsibility and needs no further internal layout.
|
||||
|
||||
The stable slots nav, sidebar, main and footer retain fragment identities. Native resource wrappers remain in the View tree; the theme transparently places their semantic children in the original grid. The class is-desk is local to this frame, replacing the old whole-body mutation. The theme projection keeps its original rules and values under that explicit scope. Pure head resources are collected into the real document head.
|
||||
|
||||
We **top = [Assemble public navigation](nav.nav())** and **rail = [Assemble the public side rail](side.side())** and **bottom = [Read the public Markdown footer](foot.foot())** and **classes = "site-layout has-sidebar"**.
|
||||
1. `management`
|
||||
We **top = [Use the desk's own navigation](desk.nav())** and **rail = [Keep the desk free of the public rail](table.empty_list())** and **bottom = [Read the desk return links](desk.foot())** and **classes = "site-layout no-sidebar is-desk"**.
|
||||
We **main = [Retain the supplied main responsibility](component.wrap(children=`body`, kind="section", slot="main", style="main"))** and **children = [Keep navigation before the public rail](table.concat(a=`top`, b=`rail`))** and **children = [Keep main content after navigation](table.concat(a=`children`, b=`main`))** and **children = [Finish with the selected footer](table.concat(a=`children`, b=`bottom`))**.
|
||||
We **frame = [Declare the shared named layout region](component.wrap(children=`children`, kind="section", slot="site", style=`classes`))** and **resources = [Retain actual SEO, fonts and compiled theme](head.nodes(homepage=`homepage`))**.
|
||||
Return *[Keep head declarations alongside the recursive frame](table.concat(a=`resources`, b=`frame`))*.
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Terminal introduction component
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
fs: lib/fs.mq.md
|
||||
---
|
||||
|
||||
The introduction ends in one ordinary Markdown responsibility: category, title, explanation, feature bullets and reading steps. Markdown provides that hierarchy directly; the theme selects those semantic elements. Page geometry stays in the parent frame, and no content row uses an HTML shell or the removed intro-binding dialect.
|
||||
|
||||
## nodes
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| name | text | required | Author-selected home, about, new, desk or post Markdown leaf |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | One semantic introduction region around the actual Markdown leaf |
|
||||
|
||||
Use `name` under the granted site root with fs.read. The relative leaf path is selected by the authored Document, never a request parameter. Missing leaves retain the native file diagnostic rather than displaying a copied fallback. Reading the leaf does not execute its emphasis or links as Marqdo statements; its content is data for the native Markdown renderer.
|
||||
|
||||
Each leaf is already simple enough for Markdown: blockquote category, heading, paragraphs, bullets and ordered steps. A change that adds independent internal geometry should split again. Style selectors preserve the original typography, badges and step panel while the page still reads as a document.
|
||||
|
||||
We **path = "components/content/" + name + ".md"** and **text = [Read this introduction's actual content](fs.read_text(path=`path`))** and **leaf = [Retain its simple Markdown hierarchy](component.markdown(text=`text`, slot="intro-content"))**.
|
||||
Return *[Keep the introduction as a semantic region](component.wrap(children=`leaf`, kind="section", slot="intro", style="main-intro"))*.
|
||||
@@ -1,20 +1,32 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Session-aware nav component
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
---
|
||||
|
||||
This module owns only the selected navigation responsibility. Its labels and destinations retain the original site order. The session-dependent rows are a typed navigation resource because their visibility must follow each request rather than a startup snapshot.
|
||||
|
||||
## nav
|
||||
|
||||
Brand first, then demo routes. Guest sees **Login**; signed-in sees **Admin** + **Logout**.
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | One typed navigation resource with stable fragment identity |
|
||||
|
||||
`nav` =
|
||||
Construction is pure and does not log in, log out or register a route. Empty when values keep links visible; guest and auth use the actual session supplied by the server. The resource renderer retains native navigation classes for the existing theme. Hiding Admin never protects its URL: the serving entry separately binds a real /admin role gate.
|
||||
|
||||
| front | back | style | media | when |
|
||||
|-------|------|-------|-------|------|
|
||||
| Marqdo | / | | | |
|
||||
| About | /about | | | |
|
||||
| New | /new | | | |
|
||||
| Login | /login | | | guest |
|
||||
| Admin | /admin | | | auth |
|
||||
| Logout | /admin/logout | | | auth |
|
||||
The parent places this region and owns its grid relationship. Edit labels here and update declared routes when changing a destination; do not concatenate an HTML navigation string or return an obsolete front/back binding table.
|
||||
|
||||
*`nav`*
|
||||
`items` =
|
||||
|
||||
| @ | label | href | when |
|
||||
|---|---|---|---|
|
||||
| 1 | Marqdo | / | |
|
||||
| 2 | About | /about | |
|
||||
| 3 | New | /new | |
|
||||
| 4 | Login | /login | guest |
|
||||
| 5 | Admin | /admin | auth |
|
||||
| 6 | Logout | /admin/logout | auth |
|
||||
|
||||
We **resource = [Describe current-session navigation](component.navigation(items=`items`, region="nav"))**.
|
||||
Return *[Keep this region as a typed View resource](component.resource(value=`resource`, slot="nav"))*.
|
||||
@@ -1,19 +1,31 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Session-aware sidebar component
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
---
|
||||
|
||||
This module owns only the selected navigation responsibility. Its labels and destinations retain the original site order. The session-dependent rows are a typed navigation resource because their visibility must follow each request rather than a startup snapshot.
|
||||
|
||||
## side
|
||||
|
||||
Hands-on demo checklist (links only — no JS).
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | One typed navigation resource with stable fragment identity |
|
||||
|
||||
`side` =
|
||||
Construction is pure and does not log in, log out or register a route. Empty when values keep links visible; guest and auth use the actual session supplied by the server. The resource renderer retains native navigation classes for the existing theme. Hiding Admin never protects its URL: the serving entry separately binds a real /admin role gate.
|
||||
|
||||
| front | back | style | media | when |
|
||||
|-------|------|-------|-------|------|
|
||||
| 1. Home | / | | | |
|
||||
| 2. New form | /new | | | |
|
||||
| 3. Login | /login | | | guest |
|
||||
| 3. Admin | /admin | | | auth |
|
||||
| About | /about | | | |
|
||||
The parent places this region and owns its grid relationship. Edit labels here and update declared routes when changing a destination; do not concatenate an HTML navigation string or return an obsolete front/back binding table.
|
||||
|
||||
*`side`*
|
||||
`items` =
|
||||
|
||||
| @ | label | href | when |
|
||||
|---|---|---|---|
|
||||
| 1 | 1. Home | / | |
|
||||
| 2 | 2. New form | /new | |
|
||||
| 3 | 3. Login | /login | guest |
|
||||
| 4 | 3. Admin | /admin | auth |
|
||||
| 5 | About | /about | |
|
||||
|
||||
We **resource = [Describe current-session navigation](component.navigation(items=`items`, region="sidebar"))**.
|
||||
Return *[Keep this region as a typed View resource](component.resource(value=`resource`, slot="sidebar"))*.
|
||||
Reference in new issue
Block a user