五个可运行示例,覆盖 Marqdo 的核心能力面:
| 文件 | 展示 |
|------|------|
| add.mq.md | 叙述统一、粗体即代码、斜体即返回 |
| invoice.mq.md | 表格即数据、循环、分支、断言 |
| calculus.mq.md | 公式即变量、求导、求根、绘图 |
| bell.mq.md | 量子电路、概率、断言、SVG 派生物 |
| foreign-node.mq.md | 外联一次性执行、持久会话、显式传值 |
全部实测跑通(1.5.2),输出与 README「预期输出」一节一致:
- add → 42
- invoice → 960 / 912 / 966 / within-cap
- calculus → 3*x^2 - 3 / 9 / [-1.73, 0, 1.73] / plot-ok
- bell → {00: 0.5, 11: 0.5} / bell-00-ok / bell-11-ok / bell-draw-ok
- foreign-node → 区域汇总表 + 持久会话复读
仓库侧改动:
- examples/oa2026-showcase/*.svg 随示例入库(README 有说明,属固定产物)
- .gitignore 忽略根目录 bell-*.svg / calculus-*.svg —— 从仓库根运行示例时
draw/plot 会把 SVG 写到 cwd,那是运行产物不是源文件
- examples/marqdo-blog/db/posts.mq.md 首行正文去掉了内嵌 `#` 标题写法
24 lines
2.7 KiB
XML
24 lines
2.7 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" width="320" height="136" viewBox="0 0 320.0 136.0" data-theme="light" role="img" aria-label="quantum circuit"><defs>
|
|
<linearGradient id="mq-bg" x1="0" y1="0" x2="1" y2="1">
|
|
<stop offset="0%" stop-color="#eef3f9"/>
|
|
<stop offset="55%" stop-color="#ffffff"/>
|
|
<stop offset="100%" stop-color="#eef3f9"/>
|
|
</linearGradient>
|
|
<filter id="mq-glow" x="-40%" y="-40%" width="180%" height="180%">
|
|
<feGaussianBlur stdDeviation="2.2" result="b"/>
|
|
<feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge>
|
|
</filter>
|
|
<filter id="mq-soft" x="-20%" y="-20%" width="140%" height="140%">
|
|
<feDropShadow dx="0" dy="1.5" stdDeviation="1.8" flood-color="#3d5afe" flood-opacity="0.35"/>
|
|
</filter>
|
|
</defs><rect width="320.0" height="136.0" rx="14" fill="url(#mq-bg)"/>
|
|
<rect x="1.5" y="1.5" width="317.0" height="133.0" rx="12.5" fill="none" stroke="#e2eaf3" stroke-width="1" opacity="0.55"/><line x1="96" y1="36" x2="296" y2="36" stroke="#4a5a6a" stroke-width="3.2" stroke-linecap="round" opacity="0.28"/>
|
|
<line x1="96" y1="36" x2="296" y2="36" stroke="#4a5a6a" stroke-width="1.8" stroke-linecap="round"/><rect x="51" y="25" width="38" height="22" rx="7" fill="#ffffff" stroke="#e2eaf3" stroke-width="1"/>
|
|
<text x="70" y="36" text-anchor="middle" dominant-baseline="middle" font-family="ui-monospace,Menlo,Consolas,monospace" font-size="13" font-weight="700" letter-spacing="0.02em" fill="#15202b">q0</text><line x1="96" y1="100" x2="296" y2="100" stroke="#4a5a6a" stroke-width="3.2" stroke-linecap="round" opacity="0.28"/>
|
|
<line x1="96" y1="100" x2="296" y2="100" stroke="#4a5a6a" stroke-width="1.8" stroke-linecap="round"/><rect x="51" y="89" width="38" height="22" rx="7" fill="#ffffff" stroke="#e2eaf3" stroke-width="1"/>
|
|
<text x="70" y="100" text-anchor="middle" dominant-baseline="middle" font-family="ui-monospace,Menlo,Consolas,monospace" font-size="13" font-weight="700" letter-spacing="0.02em" fill="#15202b">q1</text><rect x="116" y="16" width="40" height="40" rx="8" fill="#3d5afe" stroke="#ffffff" stroke-width="1.1" data-gate-family="clifford" filter="url(#mq-soft)" opacity="0.98"/>
|
|
<text x="136" y="36" text-anchor="middle" dominant-baseline="middle" font-family="ui-monospace,Menlo,Consolas,monospace" font-size="14" font-weight="700" fill="#ffffff">H</text><line x1="216" y1="36" x2="216" y2="100" stroke="#1a237e" stroke-width="2.25" data-gate-family="clifford"/>
|
|
<circle cx="216" cy="36" r="5.2" fill="#1a237e" filter="url(#mq-glow)"/>
|
|
<circle cx="216" cy="100" r="13" fill="#3d5afe" stroke="#1a237e" stroke-width="1.6" filter="url(#mq-soft)" opacity="0.96"/>
|
|
<line x1="216" y1="87" x2="216" y2="113" stroke="#1a237e" stroke-width="2"/>
|
|
<line x1="203" y1="100" x2="229" y2="100" stroke="#1a237e" stroke-width="2"/></svg> |