docs(lib): narrate table/text/json as code-as-docs pilot
Add purpose lines and bracket-call examples in EN/ZH libs and public/stdlib demos; keep explicit + params so function-body prose cannot be mistaken for link-index or bold code. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
0e0655b316
commit
53bc3538da
13 files changed
+238
-89
No files matched your search
@@ -1,14 +1,15 @@
|
||||
---
|
||||
title: lib/table — collections
|
||||
description: put, append, and map helpers
|
||||
description: put, append, and map helpers (code-as-docs pilot)
|
||||
import table:lib/table.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
Prefer `table.put` for element updates (`at=` text key, 1-based int, or list path). Use `json` for parse/stringify only.
|
||||
Prefer table.put for element updates (at= text key, 1-based int, or list path).
|
||||
Read with link-index get. Use json for parse/stringify only.
|
||||
|
||||
**`h` = > table.put in=None at="Authorization" value="Bearer-demo"**
|
||||
**`h` = [table.put] in=None at="Authorization" value="Bearer-demo"**
|
||||
|
||||
`xs` =
|
||||
|
||||
@@ -17,9 +18,9 @@ Prefer `table.put` for element updates (`at=` text key, 1-based int, or list pat
|
||||
| a |
|
||||
| b |
|
||||
|
||||
**`xs` = > table.put in=`xs` at=1 value="A"**
|
||||
**`xs` = [table.put] in=`xs` at=1 value="A"**
|
||||
**`n` = > table.rows xs=`xs`**
|
||||
|
||||
> print text=`h`[^Authorization]
|
||||
> print text=`xs`[^1]
|
||||
> print text=`n`
|
||||
**打印 内容=[Authorization](h)**
|
||||
**打印 内容=[1](xs)**
|
||||
**打印 内容=`n`**
|
||||
Reference in new issue
Block a user