docs(view): make the writeback page itself the runnable example
Move the foreign + writeback demo into the user persistence page. The page runs a Python code fence, records a keyed total slot, and the slot is visible in both source and static rendering. Remove the separate example document.
This commit is contained in:
1 parent
5acf026e0c
commit
ab6648ae0e
3 files changed
+44
-42
No files matched your search
@@ -1,34 +0,0 @@
|
||||
---
|
||||
title: Foreign result writeback
|
||||
description: Execute a foreign code fence and persist the result into this .mq.md
|
||||
import foreign:lib/foreign.mq.md
|
||||
import writeback:lib/writeback.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
This is a runnable example, not a screenshot. Run it with:
|
||||
|
||||
```text
|
||||
marqdo run examples/foreign-writeback/index.mq.md
|
||||
```
|
||||
|
||||
The foreign fence below is a normal Marqdo code value. `foreign.run` executes it;
|
||||
`writeback.record` writes the result into a keyed output slot immediately below
|
||||
the call. Re-running replaces only the `total` slot.
|
||||
|
||||
`合计代码` =
|
||||
```python
|
||||
print(950)
|
||||
```
|
||||
|
||||
**结果 = > foreign.run code=`合计代码`**
|
||||
|
||||
**> writeback.record value=`结果` key="total"**
|
||||
<!-- marqdo-out total
|
||||
950
|
||||
-->
|
||||
|
||||
The keyed slot below is generated by the run:
|
||||
|
||||
查看源码,确认 `total` 槽位就在这次 writeback 调用下方。
|
||||
Reference in new issue
Block a user