Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3eb8e732ea | ||
|
|
761b92afce |
No files matched your search
@@ -124,8 +124,9 @@ jobs:
|
|||||||
## Marqdo ${{ github.ref_name }}
|
## Marqdo ${{ github.ref_name }}
|
||||||
|
|
||||||
### 亮点 / Highlights
|
### 亮点 / Highlights
|
||||||
|
- **v1.0.1**:修复 Go `libweb` 动态路由 `{param}` 查询代入、详情 Markdown、CSS 数字误报、`/static/` ServeMux 冲突
|
||||||
|
- **v1.0.1**: fix Go `libweb` dynamic-route `{param}` query resolve, article Markdown, CSS numeric false positives, `/static/` ServeMux conflict
|
||||||
- **v1.0.0**:Markdown 语法映射 v0.3 为唯一运行时(`**` 代码 / `*` 返回 / 叙述 `` `名` ``)
|
- **v1.0.0**:Markdown 语法映射 v0.3 为唯一运行时(`**` 代码 / `*` 返回 / 叙述 `` `名` ``)
|
||||||
- **v1.0.0**: markup mapping v0.3 is the sole runtime (`**` code / `*` return / prose decls)
|
|
||||||
- **Linux 包必出**:`*-native-x86_64-unknown-linux-gnu.zip` + Linux CLI bundle
|
- **Linux 包必出**:`*-native-x86_64-unknown-linux-gnu.zip` + Linux CLI bundle
|
||||||
- Details: [CHANGELOG](https://github.com/cflmy/marqdo/blob/main/CHANGELOG.md) · [mapping v0.3](https://github.com/cflmy/marqdo/blob/main/doc/design/markdown-mapping-v0.3.md)
|
- Details: [CHANGELOG](https://github.com/cflmy/marqdo/blob/main/CHANGELOG.md) · [mapping v0.3](https://github.com/cflmy/marqdo/blob/main/doc/design/markdown-mapping-v0.3.md)
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,29 @@
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
## v1.0.1 — 2026-09-15
|
||||||
|
|
||||||
|
### Highlights
|
||||||
|
|
||||||
|
**ext/web(Go libweb)回归修复**:动态路由查询条件恢复 `{param}` 代入;详情 SSR + Markdown;样式表数字不再误报。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout v1.0.1
|
||||||
|
cargo build --release
|
||||||
|
bash ./scripts/build-web-plugin.sh
|
||||||
|
# 或:解压 Release 的 marqdo-1.0.1-*-native-*.zip / Linux CLI zip
|
||||||
|
marqdo run examples/marqdo-blog/index.mq.md
|
||||||
|
```
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Go web plugin:详情页正文 Markdown(goldmark GFM),对齐 Rust `pulldown-cmark` 路径。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **动态路由 `{param}` 未代入查询条件**(`ext/web` Go):`selectPageData` 递归展开 `query` 全部字符串叶子;`data-slot-src` / `_route` 同步替换。`examples/marqdo-blog` `/post/{slug}` 详情 SSR 恢复。
|
||||||
|
- **样式表数字单元格误报「可疑 `/` 除法」**:`cssValueSuspicious` 不再把合法 `z-index`/`opacity` 等 number 当警告。
|
||||||
|
- Go 1.22+ ServeMux:`/static/` 与 `/static/favicon.svg` 的 GET/HEAD 注册冲突导致博客启动 panic。
|
||||||
|
- Rust archive 同步:`resolve_placeholders` 递归 + CSS number 误报收窄(非默认构建路径)。
|
||||||
|
|
||||||
## v1.0.0 — 2026-09-14
|
## v1.0.0 — 2026-09-14
|
||||||
|
|
||||||
### Highlights
|
### Highlights
|
||||||
|
|||||||
Generated
+2
-2
@@ -572,7 +572,7 @@ checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "marqdo"
|
name = "marqdo"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
@@ -603,7 +603,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "marqdo-wasm"
|
name = "marqdo-wasm"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"marqdo",
|
"marqdo",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "marqdo"
|
name = "marqdo"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
description = "Marqdo — Markdown markers as an interpreted programming language"
|
description = "Marqdo — Markdown markers as an interpreted programming language"
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ marqdo catalog public -o .marqdo
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 现状(v1.0.0)
|
## 现状(v1.0.1)
|
||||||
|
|
||||||
- 映射与解释器:**v0.3 语法宪法**(`**` 代码 / `*` 返回 / 叙述声明);Phase I 树遍历 + 字节码后端;金样例在 `tests/` 与 `tests/markup-v03/`
|
- 映射与解释器:**v0.3 语法宪法**(`**` 代码 / `*` 返回 / 叙述声明);Phase I 树遍历 + 字节码后端;金样例在 `tests/` 与 `tests/markup-v03/`
|
||||||
- **对象**:`#` = 类型/构造,`##`+ = 函数/方法;见 [objects.md](doc/design/objects.md)
|
- **对象**:`#` = 类型/构造,`##`+ = 函数/方法;见 [objects.md](doc/design/objects.md)
|
||||||
@@ -120,12 +120,12 @@ marqdo catalog public -o .marqdo
|
|||||||
- **浏览器 Marqdo(WASM)**:`marqdo wasm build` + 官方 bridge 自启(作者零业务 JS;桥内可含列表/路由/storage/ws/文件/Canvas/音频/Observer/拖放);`lib/browser` + GFM;`web.client_embed`;示例 [browser-hello](examples/browser-hello/) · [browser-app](examples/browser-app/) · [browser-media](examples/browser-media/) · [web-client-site](examples/web-client-site/)([ADR 0002](doc/adr/0002-browser-marqdo-wasm.md) · [D](doc/roadmap/browser-wasm-d.md) · [E](doc/roadmap/browser-wasm-e.md) · [F](doc/roadmap/browser-wasm-f.md))
|
- **浏览器 Marqdo(WASM)**:`marqdo wasm build` + 官方 bridge 自启(作者零业务 JS;桥内可含列表/路由/storage/ws/文件/Canvas/音频/Observer/拖放);`lib/browser` + GFM;`web.client_embed`;示例 [browser-hello](examples/browser-hello/) · [browser-app](examples/browser-app/) · [browser-media](examples/browser-media/) · [web-client-site](examples/web-client-site/)([ADR 0002](doc/adr/0002-browser-marqdo-wasm.md) · [D](doc/roadmap/browser-wasm-d.md) · [E](doc/roadmap/browser-wasm-e.md) · [F](doc/roadmap/browser-wasm-f.md))
|
||||||
- 选型:[ADR 0001 — Rust](doc/adr/0001-implementation-language.md) · [ADR 0002 — 浏览器 WASM](doc/adr/0002-browser-marqdo-wasm.md)(C0–C5 完结,见 [roadmap/browser-wasm.md](doc/roadmap/browser-wasm.md))· [ADR 0003 — 异步效应](doc/adr/0003-browser-async-effects.md)
|
- 选型:[ADR 0001 — Rust](doc/adr/0001-implementation-language.md) · [ADR 0002 — 浏览器 WASM](doc/adr/0002-browser-marqdo-wasm.md)(C0–C5 完结,见 [roadmap/browser-wasm.md](doc/roadmap/browser-wasm.md))· [ADR 0003 — 异步效应](doc/adr/0003-browser-async-effects.md)
|
||||||
|
|
||||||
### 如何使用最新 Marqdo(v1.0.0)
|
### 如何使用最新 Marqdo(v1.0.1)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1) 源码安装(跟 tag 或 main)
|
# 1) 源码安装(跟 tag 或 main)
|
||||||
git clone https://github.com/cflmy/marqdo.git && cd marqdo
|
git clone https://github.com/cflmy/marqdo.git && cd marqdo
|
||||||
git checkout v1.0.0 # 或留在 main
|
git checkout v1.0.1 # 或留在 main
|
||||||
cargo build --release
|
cargo build --release
|
||||||
export PATH="$PWD/target/release:$PATH"
|
export PATH="$PWD/target/release:$PATH"
|
||||||
marqdo version
|
marqdo version
|
||||||
@@ -158,7 +158,7 @@ marqdo wasm build
|
|||||||
# → dist/wasm/ … 见 examples/browser-hello/
|
# → dist/wasm/ … 见 examples/browser-hello/
|
||||||
|
|
||||||
# 6) Releases:Windows exe/zip/vsix;Linux CLI zip + native `.so` zip
|
# 6) Releases:Windows exe/zip/vsix;Linux CLI zip + native `.so` zip
|
||||||
# https://github.com/cflmy/marqdo/releases/tag/v1.0.0
|
# https://github.com/cflmy/marqdo/releases/tag/v1.0.1
|
||||||
```
|
```
|
||||||
|
|
||||||
开发期也可用 `cargo run -- …` 代替已安装的 `marqdo`:
|
开发期也可用 `cargo run -- …` 代替已安装的 `marqdo`:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "marqdo-wasm"
|
name = "marqdo-wasm"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
description = "Marqdo interpreter as WebAssembly (browser host bridge)"
|
description = "Marqdo interpreter as WebAssembly (browser host bridge)"
|
||||||
|
|||||||
@@ -462,18 +462,8 @@ fn select_page_data(
|
|||||||
offset: i64,
|
offset: i64,
|
||||||
) -> Value {
|
) -> Value {
|
||||||
let mut where_v = args.get("query").cloned();
|
let mut where_v = args.get("query").cloned();
|
||||||
if let Some(m) = where_v.as_ref().and_then(|v| v.as_object()) {
|
if let Some(v) = where_v.take() {
|
||||||
if m.iter().any(|(_, v)| v.as_str().is_some_and(|s| s.contains('{'))) {
|
where_v = Some(resolve_placeholders(v, args));
|
||||||
let mut resolved = Map::new();
|
|
||||||
for (k, v) in m {
|
|
||||||
let v = match v {
|
|
||||||
Value::String(s) => Value::String(resolve_params(s.as_str(), args)),
|
|
||||||
other => other.clone(),
|
|
||||||
};
|
|
||||||
resolved.insert(k.clone(), v);
|
|
||||||
}
|
|
||||||
where_v = Some(Value::Object(resolved));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
let order = args.get("order").and_then(|v| v.as_str());
|
let order = args.get("order").and_then(|v| v.as_str());
|
||||||
let paginate = args.get("paginate").is_some();
|
let paginate = args.get("paginate").is_some();
|
||||||
@@ -493,6 +483,26 @@ fn select_page_data(
|
|||||||
.unwrap_or(json!({ "rows": [] }))
|
.unwrap_or(json!({ "rows": [] }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Recursively replace `{param}` in all string leaves (columnar / row tables).
|
||||||
|
fn resolve_placeholders(v: Value, args: &Value) -> Value {
|
||||||
|
match v {
|
||||||
|
Value::String(s) => Value::String(resolve_params(&s, args)),
|
||||||
|
Value::Array(arr) => Value::Array(
|
||||||
|
arr.into_iter()
|
||||||
|
.map(|x| resolve_placeholders(x, args))
|
||||||
|
.collect(),
|
||||||
|
),
|
||||||
|
Value::Object(map) => {
|
||||||
|
let mut out = Map::new();
|
||||||
|
for (k, val) in map {
|
||||||
|
out.insert(k, resolve_placeholders(val, args));
|
||||||
|
}
|
||||||
|
Value::Object(out)
|
||||||
|
}
|
||||||
|
other => other,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Replace `{param}` placeholders with values from `args["params"]` (a map).
|
/// Replace `{param}` placeholders with values from `args["params"]` (a map).
|
||||||
fn resolve_params(s: &str, args: &Value) -> String {
|
fn resolve_params(s: &str, args: &Value) -> String {
|
||||||
let params = args
|
let params = args
|
||||||
@@ -532,8 +542,11 @@ fn field_css(obj: &Map<String, Value>, field: &str) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn part_src_prefix(args: &Value) -> String {
|
fn part_src_prefix(args: &Value) -> String {
|
||||||
match args.get("_route").and_then(|v| v.as_str()) {
|
let raw = args.get("_route").and_then(|v| v.as_str()).unwrap_or("");
|
||||||
Some(r) if !r.is_empty() && r != "/" => {
|
let resolved = resolve_params(raw, args);
|
||||||
|
match resolved.as_str() {
|
||||||
|
"" | "/" => String::new(),
|
||||||
|
r => {
|
||||||
let mut p = r.to_string();
|
let mut p = r.to_string();
|
||||||
while p.len() > 1 && p.ends_with('/') {
|
while p.len() > 1 && p.ends_with('/') {
|
||||||
p.pop();
|
p.pop();
|
||||||
@@ -544,7 +557,6 @@ fn part_src_prefix(args: &Value) -> String {
|
|||||||
format!("/{p}")
|
format!("/{p}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => String::new(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -475,10 +475,9 @@ pub fn as_css_named_checked(name: &str, table: &Value, strict: bool) -> Result<S
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn css_value_suspicious(v: &Value) -> Option<&'static str> {
|
fn css_value_suspicious(v: &Value) -> Option<&'static str> {
|
||||||
|
// Numbers are normal CSS (z-index, opacity, …). Do not treat Markup-evaluated
|
||||||
|
// ints/floats as bare `/` division false positives.
|
||||||
match v {
|
match v {
|
||||||
Value::Number(_) => Some(
|
|
||||||
"numeric CSS value (likely bare `/` division such as `1 / 5`; quote the cell, e.g. `\"1 / 5\"`)",
|
|
||||||
),
|
|
||||||
Value::Bool(_) => Some("boolean CSS value (quote the cell if intentional)"),
|
Value::Bool(_) => Some("boolean CSS value (quote the cell if intentional)"),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ require (
|
|||||||
github.com/mattn/go-isatty v0.0.24 // indirect
|
github.com/mattn/go-isatty v0.0.24 // indirect
|
||||||
github.com/ncruces/go-strftime v1.0.0 // indirect
|
github.com/ncruces/go-strftime v1.0.0 // indirect
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||||
|
github.com/yuin/goldmark v1.7.8 // indirect
|
||||||
github.com/yuin/gopher-lua v1.1.1 // indirect
|
github.com/yuin/gopher-lua v1.1.1 // indirect
|
||||||
go.uber.org/atomic v1.11.0 // indirect
|
go.uber.org/atomic v1.11.0 // indirect
|
||||||
golang.org/x/sys v0.47.0 // indirect
|
golang.org/x/sys v0.47.0 // indirect
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94
|
|||||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
|
github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic=
|
||||||
|
github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||||
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
|
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
|
||||||
github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
|
github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
|
||||||
github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
|
github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
|
||||||
|
|||||||
@@ -136,19 +136,17 @@ func NewHandler(appBag map[string]any, entryDir string) (http.Handler, error) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if staticDir != "" {
|
// Icon routes before the static prefix so /static/favicon.svg does not
|
||||||
fmt.Fprintf(os.Stderr, "marqdo web static: %s → %s\n", staticMount, staticDir)
|
// conflict with Go 1.22+ ServeMux method/path overlap rules.
|
||||||
fs := http.StripPrefix(staticMount, http.FileServer(http.Dir(staticDir)))
|
|
||||||
mux.Handle("GET "+staticMount+"/", fs)
|
|
||||||
mux.Handle("HEAD "+staticMount+"/", fs)
|
|
||||||
mux.Handle("GET "+staticMount, fs)
|
|
||||||
mux.Handle("HEAD "+staticMount, fs)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, ir := range iconRoutes {
|
for _, ir := range iconRoutes {
|
||||||
url := ir.URL
|
url := ir.URL
|
||||||
path := ir.Path
|
path := ir.Path
|
||||||
ct := ir.ContentType
|
ct := ir.ContentType
|
||||||
|
if staticDir != "" && (url == staticMount || strings.HasPrefix(url, staticMount+"/")) {
|
||||||
|
// FileServer under staticMount already serves these paths.
|
||||||
|
fmt.Fprintf(os.Stderr, "marqdo web icon: %s → static %s (via %s)\n", url, path, staticMount)
|
||||||
|
continue
|
||||||
|
}
|
||||||
fmt.Fprintf(os.Stderr, "marqdo web icon: %s → %s (%s)\n", url, path, ct)
|
fmt.Fprintf(os.Stderr, "marqdo web icon: %s → %s (%s)\n", url, path, ct)
|
||||||
mux.HandleFunc("GET "+url, func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("GET "+url, func(w http.ResponseWriter, r *http.Request) {
|
||||||
st.serveIcon(w, path, ct)
|
st.serveIcon(w, path, ct)
|
||||||
@@ -158,6 +156,27 @@ func NewHandler(appBag map[string]any, entryDir string) (http.Handler, error) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if staticDir != "" {
|
||||||
|
fmt.Fprintf(os.Stderr, "marqdo web static: %s → %s\n", staticMount, staticDir)
|
||||||
|
fs := http.StripPrefix(staticMount, http.FileServer(http.Dir(staticDir)))
|
||||||
|
// Register without method so GET+HEAD share one pattern (avoids conflicts
|
||||||
|
// with more-specific GET/HEAD icon paths under the same prefix).
|
||||||
|
mux.Handle(staticMount+"/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if r.Method != http.MethodGet && r.Method != http.MethodHead {
|
||||||
|
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fs.ServeHTTP(w, r)
|
||||||
|
}))
|
||||||
|
mux.Handle(staticMount, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if r.Method != http.MethodGet && r.Method != http.MethodHead {
|
||||||
|
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fs.ServeHTTP(w, r)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
for _, from := range sortedKeys(st.redirects) {
|
for _, from := range sortedKeys(st.redirects) {
|
||||||
spec, _ := st.redirects[from].(map[string]any)
|
spec, _ := st.redirects[from].(map[string]any)
|
||||||
to := strOpt(spec, "to", "/")
|
to := strOpt(spec, "to", "/")
|
||||||
@@ -625,11 +644,18 @@ func collectPageForms(page map[string]any, forms map[string]any) {
|
|||||||
|
|
||||||
func injectParams(page map[string]any, params map[string]any) {
|
func injectParams(page map[string]any, params map[string]any) {
|
||||||
page["params"] = params
|
page["params"] = params
|
||||||
|
// Stamp concrete path onto `_route` so part slot URLs use /post/slug not /post/{slug}.
|
||||||
|
if r, ok := page["_route"].(string); ok && r != "" && len(params) > 0 {
|
||||||
|
page["_route"] = render.ResolveRouteParams(r, params)
|
||||||
|
}
|
||||||
if parts, ok := page["parts"].(map[string]any); ok {
|
if parts, ok := page["parts"].(map[string]any); ok {
|
||||||
for k, cfg := range parts {
|
for k, cfg := range parts {
|
||||||
if m, ok := cfg.(map[string]any); ok {
|
if m, ok := cfg.(map[string]any); ok {
|
||||||
cp := cloneMap(m)
|
cp := cloneMap(m)
|
||||||
cp["params"] = params
|
cp["params"] = params
|
||||||
|
if r, ok := cp["_route"].(string); ok && r != "" {
|
||||||
|
cp["_route"] = render.ResolveRouteParams(r, params)
|
||||||
|
}
|
||||||
parts[k] = cp
|
parts[k] = cp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package render
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/yuin/goldmark"
|
||||||
|
"github.com/yuin/goldmark/extension"
|
||||||
|
"github.com/yuin/goldmark/parser"
|
||||||
|
"github.com/yuin/goldmark/renderer/html"
|
||||||
|
)
|
||||||
|
|
||||||
|
// markdownToHTML renders article body Markdown to HTML (GFM subset), matching
|
||||||
|
// the Rust web plugin's pulldown-cmark path.
|
||||||
|
func markdownToHTML(md string) string {
|
||||||
|
md = strings.TrimSpace(md)
|
||||||
|
if md == "" {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
gm := goldmark.New(
|
||||||
|
goldmark.WithExtensions(
|
||||||
|
extension.GFM,
|
||||||
|
extension.Strikethrough,
|
||||||
|
),
|
||||||
|
goldmark.WithParserOptions(
|
||||||
|
parser.WithAutoHeadingID(),
|
||||||
|
),
|
||||||
|
goldmark.WithRendererOptions(
|
||||||
|
html.WithHardWraps(),
|
||||||
|
html.WithXHTML(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
var buf bytes.Buffer
|
||||||
|
if err := gm.Convert([]byte(md), &buf); err != nil {
|
||||||
|
return `<div class="article-body"><p class="article-p">` + esc(md) + `</p></div>`
|
||||||
|
}
|
||||||
|
return `<div class="article-body md">` + buf.String() + `</div>`
|
||||||
|
}
|
||||||
@@ -191,7 +191,8 @@ func navWhenVisible(when navWhen, auth *bool) bool {
|
|||||||
func selectPageData(url, tableName string, page map[string]any, limit, offset int64) map[string]any {
|
func selectPageData(url, tableName string, page map[string]any, limit, offset int64) map[string]any {
|
||||||
var where any
|
var where any
|
||||||
if q, ok := page["query"]; ok {
|
if q, ok := page["query"]; ok {
|
||||||
where = q
|
// Expand `{param}` placeholders from dynamic route params (ABI: 查询条件).
|
||||||
|
where = resolvePlaceholders(q, pageParams(page))
|
||||||
}
|
}
|
||||||
order, _ := page["order"].(string)
|
order, _ := page["order"].(string)
|
||||||
opts := db.SelectOpts{Where: where, Order: order}
|
opts := db.SelectOpts{Where: where, Order: order}
|
||||||
@@ -205,6 +206,78 @@ func selectPageData(url, tableName string, page map[string]any, limit, offset in
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func pageParams(page map[string]any) map[string]any {
|
||||||
|
if page == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
p, _ := page["params"].(map[string]any)
|
||||||
|
return p
|
||||||
|
}
|
||||||
|
|
||||||
|
// resolvePlaceholders walks query / route values and replaces `{name}` with
|
||||||
|
// page.params[name]. Unmatched placeholders are left as `{name}` for debugging.
|
||||||
|
func resolvePlaceholders(v any, params map[string]any) any {
|
||||||
|
if len(params) == 0 {
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
switch t := v.(type) {
|
||||||
|
case string:
|
||||||
|
return resolveParamsString(t, params)
|
||||||
|
case map[string]any:
|
||||||
|
out := make(map[string]any, len(t))
|
||||||
|
for k, val := range t {
|
||||||
|
out[k] = resolvePlaceholders(val, params)
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
case []any:
|
||||||
|
out := make([]any, len(t))
|
||||||
|
for i, val := range t {
|
||||||
|
out[i] = resolvePlaceholders(val, params)
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
default:
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ResolveRouteParams substitutes `{name}` in a route pattern using params.
|
||||||
|
func ResolveRouteParams(pattern string, params map[string]any) string {
|
||||||
|
return resolveParamsString(pattern, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
func resolveParamsString(s string, params map[string]any) string {
|
||||||
|
if !strings.Contains(s, "{") || len(params) == 0 {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
var out strings.Builder
|
||||||
|
rest := s
|
||||||
|
for {
|
||||||
|
start := strings.Index(rest, "{")
|
||||||
|
if start < 0 {
|
||||||
|
out.WriteString(rest)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
out.WriteString(rest[:start])
|
||||||
|
rest = rest[start+1:]
|
||||||
|
end := strings.Index(rest, "}")
|
||||||
|
if end < 0 {
|
||||||
|
out.WriteByte('{')
|
||||||
|
out.WriteString(rest)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
key := rest[:end]
|
||||||
|
if val, ok := params[key]; ok {
|
||||||
|
out.WriteString(text(val))
|
||||||
|
} else {
|
||||||
|
out.WriteByte('{')
|
||||||
|
out.WriteString(key)
|
||||||
|
out.WriteByte('}')
|
||||||
|
}
|
||||||
|
rest = rest[end+1:]
|
||||||
|
}
|
||||||
|
return out.String()
|
||||||
|
}
|
||||||
|
|
||||||
func resolveLinks(raw any, dbURL string, page map[string]any) []navLink {
|
func resolveLinks(raw any, dbURL string, page map[string]any) []navLink {
|
||||||
if raw == nil {
|
if raw == nil {
|
||||||
return nil
|
return nil
|
||||||
@@ -400,6 +473,7 @@ func fieldCSS(obj map[string]any, field string) string {
|
|||||||
|
|
||||||
func partSrcPrefix(page map[string]any) string {
|
func partSrcPrefix(page map[string]any) string {
|
||||||
r, _ := page["_route"].(string)
|
r, _ := page["_route"].(string)
|
||||||
|
r = resolveParamsString(r, pageParams(page))
|
||||||
if r == "" || r == "/" {
|
if r == "" || r == "/" {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
@@ -479,6 +553,10 @@ const shellWidgets = `
|
|||||||
.site-form { margin-top:1.25rem; max-width:28rem; }
|
.site-form { margin-top:1.25rem; max-width:28rem; }
|
||||||
.article { background:#fff; border:1px solid var(--line); border-radius:8px; padding:2rem; margin-top:1.5rem; }
|
.article { background:#fff; border:1px solid var(--line); border-radius:8px; padding:2rem; margin-top:1.5rem; }
|
||||||
.article-title { margin:0 0 .75rem; font-size:2rem; }
|
.article-title { margin:0 0 .75rem; font-size:2rem; }
|
||||||
|
.article-body { line-height:1.75; color:var(--ink); }
|
||||||
|
.article-body.md { line-height: 1.75; }
|
||||||
|
.article-body.md pre { background:#f5f5f4; border:1px solid var(--line); border-radius:6px; padding:1rem; overflow-x:auto; }
|
||||||
|
.article-body.md code { font-size:.9em; }
|
||||||
.pagination { display:flex; gap:1rem; align-items:center; margin:1.5rem 0; font-size:.95rem; }
|
.pagination { display:flex; gap:1rem; align-items:center; margin:1.5rem 0; font-size:.95rem; }
|
||||||
`
|
`
|
||||||
|
|
||||||
@@ -624,8 +702,7 @@ func renderArticle(it map[string]any) string {
|
|||||||
s.WriteString(fmt.Sprintf(`<div class="article-tags">%s</div>`, esc(tag)))
|
s.WriteString(fmt.Sprintf(`<div class="article-tags">%s</div>`, esc(tag)))
|
||||||
}
|
}
|
||||||
if body != "" {
|
if body != "" {
|
||||||
// Minimal: escape as paragraphs (full markdown deferred).
|
s.WriteString(markdownToHTML(body))
|
||||||
s.WriteString(fmt.Sprintf(`<div class="article-body"><p class="article-p">%s</p></div>`, esc(body)))
|
|
||||||
}
|
}
|
||||||
s.WriteString("</article>")
|
s.WriteString("</article>")
|
||||||
return s.String()
|
return s.String()
|
||||||
|
|||||||
@@ -227,3 +227,33 @@ func TestRenderPageNavChrome(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestResolveRouteParams(t *testing.T) {
|
||||||
|
got := render.ResolveRouteParams("/post/{slug}", map[string]any{"slug": "hello-marqdo"})
|
||||||
|
if got != "/post/hello-marqdo" {
|
||||||
|
t.Fatalf("got %q", got)
|
||||||
|
}
|
||||||
|
got = render.ResolveRouteParams("/post/{slug}", map[string]any{})
|
||||||
|
if got != "/post/{slug}" {
|
||||||
|
t.Fatalf("unmatched must stay: %q", got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartSlotSrcUsesResolvedRoute(t *testing.T) {
|
||||||
|
page := map[string]any{
|
||||||
|
"title": "post",
|
||||||
|
"intro": "",
|
||||||
|
"_route": "/post/{slug}",
|
||||||
|
"params": map[string]any{"slug": "hello-marqdo"},
|
||||||
|
"parts": map[string]any{
|
||||||
|
"index": map[string]any{"slot": "main"},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
html := render.RenderPage(page, "", "")
|
||||||
|
if strings.Contains(html, "/post/{slug}/_part/") {
|
||||||
|
t.Fatalf("slot src still has placeholder: %s", html)
|
||||||
|
}
|
||||||
|
if !strings.Contains(html, `data-slot-src="/post/hello-marqdo/_part/index"`) {
|
||||||
|
t.Fatalf("missing resolved slot src: %s", html)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package render
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/marqdo/marqdo/plugins/web/internal/db"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestResolvePlaceholdersColumnarAndRows(t *testing.T) {
|
||||||
|
params := map[string]any{"slug": "hello-marqdo"}
|
||||||
|
|
||||||
|
col := map[string]any{
|
||||||
|
"字段": []any{"slug"},
|
||||||
|
"操作": []any{"="},
|
||||||
|
"值": []any{"{slug}"},
|
||||||
|
}
|
||||||
|
got := resolvePlaceholders(col, params).(map[string]any)
|
||||||
|
vals := got["值"].([]any)
|
||||||
|
if vals[0] != "hello-marqdo" {
|
||||||
|
t.Fatalf("columnar 值=%v", vals)
|
||||||
|
}
|
||||||
|
|
||||||
|
rows := []any{
|
||||||
|
map[string]any{"字段": "slug", "操作": "=", "值": "{slug}"},
|
||||||
|
}
|
||||||
|
gotRows := resolvePlaceholders(rows, params).([]any)
|
||||||
|
m := gotRows[0].(map[string]any)
|
||||||
|
if m["值"] != "hello-marqdo" {
|
||||||
|
t.Fatalf("row 值=%v", m["值"])
|
||||||
|
}
|
||||||
|
|
||||||
|
top := map[string]any{"slug": "{slug}"}
|
||||||
|
gotTop := resolvePlaceholders(top, params).(map[string]any)
|
||||||
|
if gotTop["slug"] != "hello-marqdo" {
|
||||||
|
t.Fatalf("map string=%v", gotTop["slug"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSelectPageDataResolvesSlug(t *testing.T) {
|
||||||
|
dir := t.TempDir()
|
||||||
|
dbPath := filepath.Join(dir, "t.db")
|
||||||
|
url := "sqlite:" + dbPath
|
||||||
|
t.Cleanup(db.ResetPool)
|
||||||
|
|
||||||
|
fields := []any{
|
||||||
|
map[string]any{"name": "slug", "type": "text", "nullable": false},
|
||||||
|
map[string]any{"name": "title", "type": "text", "nullable": false},
|
||||||
|
map[string]any{"name": "body", "type": "text", "nullable": true},
|
||||||
|
}
|
||||||
|
if _, err := db.Init(url, "posts", fields); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if _, err := db.Insert(url, "posts", []any{
|
||||||
|
map[string]any{"slug": "hello-marqdo", "title": "Hello", "body": "## Hi\n\n*world*"},
|
||||||
|
}); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
page := map[string]any{
|
||||||
|
"title": "post",
|
||||||
|
"detail": true,
|
||||||
|
"_route": "/post/{slug}",
|
||||||
|
"params": map[string]any{"slug": "hello-marqdo"},
|
||||||
|
"query": map[string]any{
|
||||||
|
"字段": []any{"slug"},
|
||||||
|
"操作": []any{"="},
|
||||||
|
"值": []any{"{slug}"},
|
||||||
|
},
|
||||||
|
"main": []any{
|
||||||
|
map[string]any{"front": "title", "back": "posts.title"},
|
||||||
|
map[string]any{"front": "body", "back": "posts.body"},
|
||||||
|
},
|
||||||
|
"parts": map[string]any{
|
||||||
|
"index": map[string]any{"slot": "main"},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
html := RenderPage(page, url, "")
|
||||||
|
if !strings.Contains(html, `class="article-title"`) || !strings.Contains(html, "Hello") {
|
||||||
|
t.Fatalf("missing article title: %s", html)
|
||||||
|
}
|
||||||
|
if !strings.Contains(html, `class="article-body md"`) {
|
||||||
|
t.Fatalf("missing markdown body wrapper: %s", html)
|
||||||
|
}
|
||||||
|
if !strings.Contains(html, "world") {
|
||||||
|
t.Fatalf("missing markdown content: %s", html)
|
||||||
|
}
|
||||||
|
if strings.Contains(html, "{slug}") {
|
||||||
|
t.Fatalf("literal {slug} still present: %s", html)
|
||||||
|
}
|
||||||
|
if !strings.Contains(html, `/post/hello-marqdo/_part/`) {
|
||||||
|
t.Fatalf("slot prefix not resolved: %s", html)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMarkdownToHTML(t *testing.T) {
|
||||||
|
out := markdownToHTML("## Title\n\n**bold** and `code`")
|
||||||
|
if !strings.Contains(out, `class="article-body md"`) {
|
||||||
|
t.Fatalf("%s", out)
|
||||||
|
}
|
||||||
|
if !strings.Contains(out, "<h2") || !strings.Contains(out, "<strong>bold</strong>") {
|
||||||
|
t.Fatalf("%s", out)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,12 +38,30 @@ func TestStyleStrictKeepsQuotedSlash(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStyleStrictRejectsNumeric(t *testing.T) {
|
func TestStyleStrictAllowsNumeric(t *testing.T) {
|
||||||
|
css, err := style.Style(map[string]any{
|
||||||
|
"name": "x",
|
||||||
|
"strict": true,
|
||||||
|
"table": []any{
|
||||||
|
map[string]any{"选择器": ".x", "属性": "z-index", "值": float64(20)},
|
||||||
|
map[string]any{"选择器": ".y", "属性": "opacity", "值": float64(0.5)},
|
||||||
|
map[string]any{"选择器": ".z", "属性": "font-weight", "值": float64(700)},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("numeric CSS must not be suspicious: %v", err)
|
||||||
|
}
|
||||||
|
if !strings.Contains(css, "z-index: 20") || !strings.Contains(css, "opacity: 0.5") {
|
||||||
|
t.Fatalf("%q", css)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestStyleStrictRejectsBoolean(t *testing.T) {
|
||||||
_, err := style.Style(map[string]any{
|
_, err := style.Style(map[string]any{
|
||||||
"name": "x",
|
"name": "x",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"table": []any{
|
"table": []any{
|
||||||
map[string]any{"选择器": ".x", "属性": "grid-column", "值": float64(0)},
|
map[string]any{"选择器": ".x", "属性": "display", "值": true},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err == nil || !strings.Contains(err.Error(), "suspicious") {
|
if err == nil || !strings.Contains(err.Error(), "suspicious") {
|
||||||
|
|||||||
@@ -693,9 +693,9 @@ func AsCSSNamedChecked(name string, table any, strict bool) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func cssValueSuspicious(v any) string {
|
func cssValueSuspicious(v any) string {
|
||||||
|
// Numbers are normal CSS (z-index, opacity, font-weight, unitless 0).
|
||||||
|
// Do not treat Markup-evaluated ints/floats as "bare `/` division".
|
||||||
switch v.(type) {
|
switch v.(type) {
|
||||||
case float64, int, int64:
|
|
||||||
return "numeric CSS value (likely bare `/` division such as `1 / 5`; quote the cell, e.g. `\"1 / 5\"`)"
|
|
||||||
case bool:
|
case bool:
|
||||||
return "boolean CSS value (quote the cell if intentional)"
|
return "boolean CSS value (quote the cell if intentional)"
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ ext/llm — OpenAI-compatible chat. Design: doc/design/ext-llm.md
|
|||||||
|
|
||||||
ext/agent — agent framework + native plugin. Design: doc/design/ext-agent.md
|
ext/agent — agent framework + native plugin. Design: doc/design/ext-agent.md
|
||||||
|
|
||||||
ext/web — HTTP / SQLite·Postgres site helpers + native plugin (default *Go libweb*, v0.4.0). **W0–W7 + P3 + W8** + **customization C0–C4**; acceptance example `examples/anlian-mq/`. **Browser embed (routes D/E/F, v0.3.4)**: `web.client_embed` auto-mounts WASM — zero author JS; `lib/browser` + GFM tables; build with `marqdo wasm build`; examples: browser-hello · browser-app · browser-media · web-client-site. Design: doc/design/ext-web.md · WASM: doc/adr/0002-browser-marqdo-wasm.md · roadmaps D/E/F.
|
ext/web — HTTP / SQLite·Postgres site helpers + native plugin (default *Go libweb*, v0.4.0). W0–W7, P3, W8, and customization C0–C4; acceptance example `examples/anlian-mq/`. Browser embed (routes D/E/F, v0.3.4): `web.client_embed` auto-mounts WASM — zero author JS; `lib/browser` + GFM tables; build with `marqdo wasm build`; examples: browser-hello · browser-app · browser-media · web-client-site. Design: doc/design/ext-web.md · WASM: doc/adr/0002-browser-marqdo-wasm.md · roadmaps D/E/F.
|
||||||
|
|
||||||
ext/quantum — circuits, draw, noise, formula matrix custom gates, Q7 density/viz, Q8 themed SVG (`theme=dark|light|bw`). Design: doc/design/ext-quantum.md · doc/design/ext-quantum-viz-style.md
|
ext/quantum — circuits, draw, noise, formula matrix custom gates, Q7 density/viz, Q8 themed SVG (`theme=dark|light|bw`). Design: doc/design/ext-quantum.md · doc/design/ext-quantum-viz-style.md
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ ext/llm(大模型)— OpenAI 兼容聊天。设计:doc/design/ext-llm.md
|
|||||||
|
|
||||||
ext/agent(智能体)— 智能体框架 + 原生插件。设计:doc/design/ext-agent.md
|
ext/agent(智能体)— 智能体框架 + 原生插件。设计:doc/design/ext-agent.md
|
||||||
|
|
||||||
ext/web(网页)— HTTP / SQLite 站点助手 + 原生插件(默认 *Go libweb*,v0.4.0)。**W0–W7 + P3 + W8** + **定制 C0–C4**;验收示例 `examples/anlian-mq/`。**浏览器挂载(路线 D/E/F,v0.3.4)**:`网页.客户端挂载` / `web.client_embed` 自动 mount(作者零业务 JS);`lib/浏览器` + GFM;先 `marqdo wasm build`;示例 examples/browser-hello/ · examples/browser-app/ · examples/browser-media/ · examples/web-client-site/。设计:doc/design/ext-web.md · WASM:doc/adr/0002-browser-marqdo-wasm.md · 路线 D/E/F:doc/roadmap/browser-wasm-*.md
|
ext/web(网页)— HTTP / SQLite 站点助手 + 原生插件(默认 *Go libweb*,v0.4.0)。W0–W7、P3、W8 与定制 C0–C4;验收示例 `examples/anlian-mq/`。浏览器挂载(路线 D/E/F,v0.3.4):`网页.客户端挂载` / `web.client_embed` 自动 mount(作者零业务 JS);`lib/浏览器` + GFM;先 `marqdo wasm build`;示例 examples/browser-hello/ · examples/browser-app/ · examples/browser-media/ · examples/web-client-site/。设计:doc/design/ext-web.md · WASM:doc/adr/0002-browser-marqdo-wasm.md · 路线 D/E/F:doc/roadmap/browser-wasm-*.md
|
||||||
|
|
||||||
ext/quantum(量子)— 电路、绘图、噪声、公式矩阵自定义门、Q7 密度/高级图、Q8 主题 SVG(`主题=dark|light|bw`)。设计:doc/design/ext-quantum.md · doc/design/ext-quantum-viz-style.md
|
ext/quantum(量子)— 电路、绘图、噪声、公式矩阵自定义门、Q7 密度/高级图、Q8 主题 SVG(`主题=dark|light|bw`)。设计:doc/design/ext-quantum.md · doc/design/ext-quantum-viz-style.md
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ Light statistics and optional `fields=` on log lines — no remote sinks, no dat
|
|||||||
|
|
||||||
`fld` =
|
`fld` =
|
||||||
|
|
||||||
| step |
|
| step | status |
|
||||||
|------|
|
|------|--------|
|
||||||
| done |
|
| done | ok |
|
||||||
|
|
||||||
> log.info text="mid2-m10" fields=`fld`
|
> log.info text="mid2-m10" fields=`fld`
|
||||||
@@ -13,7 +13,7 @@ No extra allow flags: importing a module means you intend to use it. Under marqd
|
|||||||
|
|
||||||
Modules: text (text / 文本), table (table / 表), files (fs / 文件), time (time / 时间), system (sys / 系统), json (json only), net (net / 网络), math (math / 数学), foreign (foreign / 外联), plugin (plugin / 插件), writeback (writeback / 自写回), subtask (subtask / 子任务).
|
Modules: text (text / 文本), table (table / 表), files (fs / 文件), time (time / 时间), system (sys / 系统), json (json only), net (net / 网络), math (math / 数学), foreign (foreign / 外联), plugin (plugin / 插件), writeback (writeback / 自写回), subtask (subtask / 子任务).
|
||||||
|
|
||||||
From **v0.1.2**, official `lib/*.mq.md` is **embedded in the `marqdo` binary** (disk `lib/` or `MARQDO_LIB` still overrides). Standalone `.exe` works without a separate stdlib zip.
|
From v0.1.2, official `lib/*.mq.md` is embedded in the `marqdo` binary (disk `lib/` or `MARQDO_LIB` still overrides). Standalone `.exe` works without a separate stdlib zip.
|
||||||
|
|
||||||
Official optional extensions live under ext/ (not stdlib): ext/llm, ext/agent — see features/05-extensions.mq.md and doc/design/ext-llm.md / ext-agent.md.
|
Official optional extensions live under ext/ (not stdlib): ext/llm, ext/agent — see features/05-extensions.mq.md and doc/design/ext-llm.md / ext-agent.md.
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ description: 如何导入官方 lib 模块
|
|||||||
|
|
||||||
模块:文本(text / 文本)、表(table / 表)、文件(fs / 文件)、时间(time / 时间)、系统(sys / 系统)、json(仅 json)、网络(net / 网络)、数学(math / 数学)、外联(foreign / 外联)、插件(plugin / 插件)、自写回(writeback / 自写回)、子任务(subtask / 子任务)。
|
模块:文本(text / 文本)、表(table / 表)、文件(fs / 文件)、时间(time / 时间)、系统(sys / 系统)、json(仅 json)、网络(net / 网络)、数学(math / 数学)、外联(foreign / 外联)、插件(plugin / 插件)、自写回(writeback / 自写回)、子任务(subtask / 子任务)。
|
||||||
|
|
||||||
自 **v0.1.2** 起,官方 `lib/*.mq.md` **内置于 `marqdo` 二进制**(磁盘 `lib/` 或 `MARQDO_LIB` 仍可覆盖)。单独下载 `.exe` 即可导入标准库,无需再解压 stdlib 包。
|
自 v0.1.2 起,官方 `lib/*.mq.md` 内置于 `marqdo` 二进制(磁盘 `lib/` 或 `MARQDO_LIB` 仍可覆盖)。单独下载 `.exe` 即可导入标准库,无需再解压 stdlib 包。
|
||||||
|
|
||||||
官方可选扩展在 ext/(不是标准库):ext/llm、ext/agent — 见 features/05-扩展.mq.md。
|
官方可选扩展在 ext/(不是标准库):ext/llm、ext/agent — 见 features/05-扩展.mq.md。
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user