From 01468ad9761aabb75ebf18a5a2b9a3240d0d22cb Mon Sep 17 00:00:00 2001 From: cflmy Date: Sun, 18 Oct 2026 12:22:36 +0800 Subject: [PATCH] test(view): add foreign and non-foreign preview fixtures Add a pure Marqdo control page and make the Python view-cells example explicitly import lib/foreign. --- tests/notebook/no-foreign.mq.md | 31 ++++++++++++++++++++++++++++ tests/notebook/python-insights.mq.md | 3 ++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/notebook/no-foreign.mq.md diff --git a/tests/notebook/no-foreign.mq.md b/tests/notebook/no-foreign.mq.md new file mode 100644 index 0000000..367a89e --- /dev/null +++ b/tests/notebook/no-foreign.mq.md @@ -0,0 +1,31 @@ +--- +title: View without foreign +description: A pure Marqdo document — formula, table, plot and prose, no external kernel +import math:lib/math.mq.md +--- + +# main + +This page has no foreign import and no ` ```lang ` code cell. It is still opened by the same `view` surface, with the same toolbar and layout. The cell list is simply empty. + +The formula is ordinary Marqdo data: + +$$ +% marqdo: var=f +x^2 - 2 +$$ + +**_plot = math.plot formula=`f` var="x" min=-4 max=4** + +| region | orders | revenue | +|--------|--------|---------| +| 华东 | 45 | 56253 | +| 华南 | 45 | 67187 | +| 华北 | 45 | 65272 | +| 西部 | 45 | 66884 | + +**total = 56253 + 67187 + 65272 + 66884** + +> print text=`total` + +This is the control page: no foreign, no cells, no separate mode. The same view shell is used. diff --git a/tests/notebook/python-insights.mq.md b/tests/notebook/python-insights.mq.md index faf3b1d..948e1b6 100644 --- a/tests/notebook/python-insights.mq.md +++ b/tests/notebook/python-insights.mq.md @@ -1,6 +1,7 @@ --- -title: Python 经营洞察 Notebook +title: Python 经营洞察 · View Cells description: 多 cell 共享 Python 内核,做订单生成、区域/产品指标、异常检测、报告输出与独立复核。 +import foreign:lib/foreign.mq.md --- # main