marqdo

00-欢迎ok

00-欢迎.mq.md

Structure

import数学:lib/数学.mq.md外联:lib/外联.mq.md
fn · h1main
comment

阅读到这里的朋友你好!我是 Marqdo 的开发者。Marqdo 是一门代码即文档,文档即代码的语言:Markdown 标记就是程序结构,你读到的就是能跑的程序。

comment

AI 偏爱 Markdown结构的输出。作者的念头是:何必再把文档和代码拆成两套?我们来实现一个文档即代码的语言,所以marqdo应运而生,为了确保代码一定可以被渲染,marqdo的文件后缀定义为了.mq.md。在开发之处我们就尝试希望更丰富的支持,自动生成一个yaml文件使得 OKF 式知识库便捷的自动配置,乃至自动生成ppt,自然这都是以后的目标了。不过相当不错的是,至少这会成为一个不错的博客工具——对,这个站点就是 Marqdo 生成的,而且AI输出的时候会节约不少token,你知道的,token烧的太多,钱包会可怜的饿瘦的。

comment

语言仍在起步:结构标记、中英内核双名(打印 / print …)、可导入的标准库(见本站 stdlib/)、本地 view 与静态导出。欢迎到 GitHub 一起做。

fn · h2安装
comment

解释器(CLI)任选其一:

expr{方式: [Ubuntu PPA, GitHub Releases, 源码], 说明: [`sudo add-apt-repository ppa:cflmy/marqdo` 后 `sudo apt install marqdo`, [releases](https://github.com/cflmy/marqdo/releases) 下载 Windows / Linux 预编译包, `cargo build --release`(需本机 Rust)]}
comment

官方扩展与 CLI 可分开更新。安装扩展:

comment

text marqdo ext add web marqdo ext add quantum

comment

ext add 下载顺序:CDN https://ext.marqdo.com → GitHub → proxy 镜像。详见本站 features/05-扩展.mq.md

comment

English docs: 00-welcome.mq.md (English prose and English builtins).

comment

用一个小函数打个招呼:

call> 问候 谁=marqdo
comment

具名实参可以带空格:

call> 问候 谁=marqdo user
fn · h2问候
call> 打印 内容=欢迎,`谁`!
returnNone
comment

除了上面的一些基本内容之外,我还开发了这个语言的一些标准库,包括表、时间、文本、文件、系统、数学和外联等标准库。

comment

其中数学库和外联库是我要着重提到的,例如数学库,你可以通过下面的方式调用:

formula `f` =
$$x^{2} - 2$$
comment

之后让我们画个图像吧!

bind `_svg` = > 数学.绘图 formula=`f` var=x min=-3 max=3
comment

外联库则允许你调用外部代码,例如:

code `hi` = python
print("hello-from-python")
comment

这些代码在markdown下面都非常的易读,就像我说的,marqdo的设计思想就是代码即文档, 文档即代码。

comment

最后,再次欢迎你,尽情体验marqdo吧!

Functions
Variables
  • _svg text
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 520 360" width="520" height="360" role="img" aria-label="function plot"> <defs> <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"> <path d="M 0 0 L 10 5 L 0 10 z" fill="#4b5563"/> </marker> </defs> <style> .grid { stroke: #e5e7eb; stroke-width: 1; } .axis { stroke: #4b5563; stroke-width: 1.5; } .tick { stroke: #4b5563; stroke-width: 1; } .curve { fill: none; stroke: #1f6feb; stroke-width: 2; } .pt { fill: #1f6feb; } .axis-label { font: 12px ui-sans-serif, system-ui, sans-serif; fill: #374151; font-weight: 600; } .tick-label { font: 10px ui-sans-serif, system-ui, sans-serif; fill: #6b7280; } </style> <line x1="36.00" y1="36" x2="36.00" y2="324" class="grid"/><line x1="110.67" y1="36" x2="110.67" y2="324" class="grid"/><line x1="185.33" y1="36" x2="185.33" y2="324" class="grid"/><line x1="260.00" y1="36" x2="260.00" y2="324" class="grid"/><line x1="334.67" y1="36" x2="334.67" y2="324" class="grid"/><line x1="409.33" y1="36" x2="409.33" y2="324" class="grid"/><line x1="484.00" y1="36" x2="484.00" y2="324" class="grid"/><line x1="36" y1="310.91" x2="484" y2="310.91" class="grid"/><line x1="36" y1="252.73" x2="484" y2="252.73" class="grid"/><line x1="36" y1="194.55" x2="484" y2="194.55" class="grid"/><line x1="36" y1="136.36" x2="484" y2="136.36" class="grid"/><line x1="36" y1="78.18" x2="484" y2="78.18" class="grid"/><line x1="36" y1="252.73" x2="484" y2="252.73" class="axis" marker-end="url(#arrow)"/><line x1="260.00" y1="324" x2="260.00" y2="36" class="axis" marker-end="url(#arrow)"/><text x="488.00" y="256.73" class="axis-label">x</text><text x="266.00" y="40.00" class="axis-label">y</text><line x1="36.00" y1="248.73" x2="36.00" y2="256.73" class="tick"/><text x="36.00" y="266.73" text-anchor="middle" class="tick-label">-3</text><line x1="110.67" y1="248.73" x2="110.67" y2="256.73" class="tick"/><text x="110.67" y="266.73" text-anchor="middle" class="tick-label">-2</text><line x1="185.33" y1="248.73" x2="185.33" y2="256.73" class="tick"/><text x="185.33" y="266.73" text-anchor="middle" class="tick-label">-1</text><line x1="334.67" y1="248.73" x2="334.67" y2="256.73" class="tick"/><text x="334.67" y="266.73" text-anchor="middle" class="tick-label">1</text><line x1="409.33" y1="248.73" x2="409.33" y2="256.73" class="tick"/><text x="409.33" y="266.73" text-anchor="middle" class="tick-label">2</text><line x1="484.00" y1="248.73" x2="484.00" y2="256.73" class="tick"/><text x="484.00" y="266.73" text-anchor="middle" class="tick-label">3</text><line x1="256.00" y1="310.91" x2="264.00" y2="310.91" class="tick"/><text x="252.00" y="310.91" text-anchor="end" dominant-baseline="middle" class="tick-label">-2</text><line x1="256.00" y1="194.55" x2="264.00" y2="194.55" class="tick"/><text x="252.00" y="194.55" text-anchor="end" dominant-baseline="middle" class="tick-label">2</text><line x1="256.00" y1="136.36" x2="264.00" y2="136.36" class="tick"/><text x="252.00" y="136.36" text-anchor="end" dominant-baseline="middle" class="tick-label">4</text><line x1="256.00" y1="78.18" x2="264.00" y2="78.18" class="tick"/><text x="252.00" y="78.18" text-anchor="end" dominant-baseline="middle" class="tick-label">6</text><text x="252.00" y="266.73" class="tick-label">0</text><path d="M 36.00 49.09 L 38.24 54.30 L 40.48 59.46 L 42.72 64.56 L 44.96 69.62 L 47.20 74.62 L 49.44 79.57 L 51.68 84.46 L 53.92 89.31 L 56.16 94.10 L 58.40 98.84 L 60.64 103.52 L 62.88 108.16 L 65.12 112.74 L 67.36 117.27 L 69.60 121.75 L 71.84 126.17 L 74.08 130.54 L 76.32 134.86 L 78.56 139.13 L 80.80 143.35 L 83.04 147.51 L 85.28 151.62 L 87.52 155.68 L 89.76 159.68 L 92.00 163.64 L 94.24 167.54 L 96.48 171.39 L 98.72 175.18 L 100.96 178.93 L 103.20 182.62 L 105.44 186.26 L 107.68 189.84 L 109.92 193.38 L 112.16 196.86 L 114.40 200.29 L 116.64 203.67 L 118.88 206.99 L 121.12 210.27 L 123.36 213.49 L 125.60 216.65 L 127.84 219.77 L 130.08 222.83 L 132.32 225.84 L 134.56 228.80 L 136.80 231.71 L 139.04 234.56 L 141.28 237.36 L 143.52 240.11 L 145.76 242.81 L 148.00 245.45 L 150.24 248.05 L 152.48 250.59 L 154.72 253.07 L 156.96 255.51 L 159.20 257.89 L 161.44 260.22 L 163.68 262.50 L 165.92 264.72 L 168.16 266.90 L 170.40 269.02 L 172.64 271.09 L 174.88 273.10 L 177.12 275.07 L 179.36 276.98 L 181.60 278.84 L 183.84 280.64 L 186.08 282.40 L 188.32 284.10 L 190.56 285.75 L 192.80 287.35 L 195.04 288.89 L 197.28 290.38 L 199.52 291.82 L 201.76 293.21 L 204.00 294.55 L 206.24 295.83 L 208.48 297.06 L 210.72 298.24 L 212.96 299.36 L 215.20 300.44 L 217.44 301.46 L 219.68 302.43 L 221.92 303.34 L 224.16 304.21 L 226.40 305.02 L 228.64 305.78 L 230.88 306.48 L 233.12 307.14 L 235.36 307.74 L 237.60 308.29 L 239.84 308.79 L 242.08 309.23 L 244.32 309.63 L 246.56 309.97 L 248.80 310.25 L 251.04 310.49 L 253.28 310.67 L 255.52 310.80 L 257.76 310.88 L 260.00 310.91 L 262.24 310.88 L 264.48 310.80 L 266.72 310.67 L 268.96 310.49 L 271.20 310.25 L 273.44 309.97 L 275.68 309.63 L 277.92 309.23 L 280.16 308.79 L 282.40 308.29 L 284.64 307.74 L 286.88 307.14 L 289.12 306.48 L 291.36 305.78 L 293.60 305.02 L 295.84 304.21 L 298.08 303.34 L 300.32 302.43 L 302.56 301.46 L 304.80 300.44 L 307.04 299.36 L 309.28 298.24 L 311.52 297.06 L 313.76 295.83 L 316.00 294.55 L 318.24 293.21 L 320.48 291.82 L 322.72 290.38 L 324.96 288.89 L 327.20 287.35 L 329.44 285.75 L 331.68 284.10 L 333.92 282.40 L 336.16 280.64 L 338.40 278.84 L 340.64 276.98 L 342.88 275.07 L 345.12 273.10 L 347.36 271.09 L 349.60 269.02 L 351.84 266.90 L 354.08 264.72 L 356.32 262.50 L 358.56 260.22 L 360.80 257.89 L 363.04 255.51 L 365.28 253.07 L 367.52 250.59 L 369.76 248.05 L 372.00 245.45 L 374.24 242.81 L 376.48 240.11 L 378.72 237.36 L 380.96 234.56 L 383.20 231.71 L 385.44 228.80 L 387.68 225.84 L 389.92 222.83 L 392.16 219.77 L 394.40 216.65 L 396.64 213.49 L 398.88 210.27 L 401.12 206.99 L 403.36 203.67 L 405.60 200.29 L 407.84 196.86 L 410.08 193.38 L 412.32 189.84 L 414.56 186.26 L 416.80 182.62 L 419.04 178.93 L 421.28 175.18 L 423.52 171.39 L 425.76 167.54 L 428.00 163.64 L 430.24 159.68 L 432.48 155.68 L 434.72 151.62 L 436.96 147.51 L 439.20 143.35 L 441.44 139.13 L 443.68 134.86 L 445.92 130.54 L 448.16 126.17 L 450.40 121.75 L 452.64 117.27 L 454.88 112.74 L 457.12 108.16 L 459.36 103.52 L 461.60 98.84 L 463.84 94.10 L 466.08 89.31 L 468.32 84.46 L 470.56 79.57 L 472.80 74.62 L 475.04 69.62 L 477.28 64.56 L 479.52 59.46 L 481.76 54.30 L 484.00 49.09" class="curve"/> </svg>
  • f formula
    $$x^{2} - 2$$
  • hi code · python
    ```python print("hello-from-python") ```

Execution

(no stdout)
xy-3-2-1123-22460

Source

---
title: 欢迎使用 Marqdo
description: 用户文档首页 — 代码即文档(中文版)
导入 数学:lib/数学.mq.md
导入 外联:lib/外联.mq.md
---

# main

阅读到这里的朋友你好!我是 Marqdo 的开发者。Marqdo 是一门*代码即文档,文档即代码*的语言:Markdown 标记就是程序结构,你读到的就是能跑的程序。

AI 偏爱 Markdown结构的输出。作者的念头是:何必再把文档和代码拆成两套?我们来实现一个文档即代码的语言,所以marqdo应运而生,为了确保代码一定可以被渲染,marqdo的文件后缀定义为了`.mq.md`。在开发之处我们就尝试希望更丰富的支持,自动生成一个yaml文件使得 OKF 式知识库便捷的自动配置,乃至自动生成ppt,自然这都是以后的目标了。不过相当不错的是,至少这会成为一个不错的博客工具——对,这个站点就是 Marqdo 生成的,而且AI输出的时候会节约不少token,你知道的,token烧的太多,钱包会可怜的饿瘦的。

语言仍在起步:结构标记、中英内核双名(`打印` / `print` …)、可导入的标准库(见本站 [`stdlib/`](stdlib/))、本地 `view` 与静态导出。欢迎到 [GitHub](https://github.com/cflmy/marqdo) 一起做。

## 安装

解释器(CLI)任选其一:

| 方式 | 说明 |
|------|------|
| Ubuntu PPA | `sudo add-apt-repository ppa:cflmy/marqdo` 后 `sudo apt install marqdo` |
| GitHub Releases | [releases](https://github.com/cflmy/marqdo/releases) 下载 Windows / Linux 预编译包 |
| 源码 | `cargo build --release`(需本机 Rust) |

官方扩展与 CLI 可分开更新。安装扩展:

```text
marqdo ext add web
marqdo ext add quantum
```

`ext add` 下载顺序:CDN https://ext.marqdo.com → GitHub → proxy 镜像。详见本站 [`features/05-扩展.mq.md`](features/05-扩展.mq.md)。

English docs: [`00-welcome.mq.md`](00-welcome.mq.md) (English prose and English builtins).

用一个小函数打个招呼:

> 问候 谁=marqdo

具名实参可以带空格:

> 问候 谁=marqdo user

## 问候
    + `谁`

> 打印 内容=欢迎,`谁`!

*None*

除了上面的一些基本内容之外,我还开发了这个语言的一些标准库,包括表、时间、文本、文件、系统、数学和外联等标准库。

其中数学库和外联库是我要着重提到的,例如数学库,你可以通过下面的方式调用:

`f` =
$$
x^2 - 2
$$

之后让我们画个图像吧!

**`_svg` = > 数学.绘图 formula=`f` var="x" min=-3 max=3**

外联库则允许你调用外部代码,例如:

`hi` =
```python
print("hello-from-python")
```

这些代码在markdown下面都非常的易读,就像我说的,marqdo的设计思想就是代码即文档,
文档即代码。

最后,再次欢迎你,尽情体验marqdo吧!

Variable