Support $$ % marqdo: var= binding, arm/loop narrative (fix comment-paragraph swallow of branch arms), foreach ZH/EN sugar, and condition-line narrative. Welcome pages and gold samples updated; view skips meta formula fence bodies. Co-authored-by: Cursor <cursoragent@cursor.com>
64 lines
2.6 KiB
Markdown
64 lines
2.6 KiB
Markdown
---
|
|
title: Welcome to Marqdo
|
|
description: User-docs home — code as documentation (English)
|
|
import math:lib/math.mq.md
|
|
import foreign:lib/foreign.mq.md
|
|
---
|
|
|
|
# main
|
|
|
|
Hello — and welcome. I built Marqdo so that code is documentation and documentation is code: Markdown markers are the program structure, so what you read is what runs.
|
|
|
|
AI systems already favor Markdown-shaped output. That raised a simple question: why keep docs and programs as two separate artifacts? Marqdo is the answer. The `.mq.md` suffix exists so a file stays renderable as Markdown while remaining executable. Richer OKF-style YAML catalogs and even slide decks are on the roadmap; for now this site itself is generated by Marqdo — and that often saves tokens when an AI is writing with you.
|
|
|
|
The language is still early: structural markers, English/Chinese builtin aliases (`print` / `打印` …), an importable standard library (see [`stdlib/`](stdlib/) on this site), local `view`, and static export. Join in at [GitHub](https://github.com/cflmy/marqdo).
|
|
|
|
中文文档请看同目录的 [`00-欢迎.mq.md`](00-欢迎.mq.md)(叙述与内置均用中文)。
|
|
|
|
Want a quick hello? Calls only run when they sit in the entry `# main` — `##` children are methods until something calls them. Try **greet who="marqdo"**. Names can include spaces: **greet who="marqdo user"**.
|
|
|
|
Beyond the basics, Marqdo ships table, time, text, files, system, math, foreign, and more. Math and foreign deserve a special mention.
|
|
|
|
Write a math block and bind it with a TeX comment:
|
|
|
|
$$
|
|
% marqdo: var=f
|
|
x^2 - 2
|
|
$$
|
|
|
|
Then plot it: **_svg = math.plot formula=`f` var="x" min=-3 max=3**
|
|
|
|
Foreign lets you embed another language. Bind `hi` to a small Python block:
|
|
|
|
`hi` =
|
|
```python
|
|
print("hello-from-python")
|
|
```
|
|
|
|
Under Markdown this stays easy to read — which is the point: code as documentation, documentation as code.
|
|
|
|
Welcome again — enjoy exploring Marqdo.
|
|
|
|
## greet
|
|
|
|
When we meet a visitor `who`, we **print text="Welcome, `who`!"** and close with*None*.
|
|
|
|
## install
|
|
|
|
Install the interpreter (CLI) in any of these ways:
|
|
|
|
| Way | Notes |
|
|
|------|------|
|
|
| Ubuntu PPA | `sudo add-apt-repository ppa:cflmy/marqdo` then `sudo apt install marqdo` |
|
|
| GitHub Releases | Prebuilt Windows / Linux packages from [releases](https://github.com/cflmy/marqdo/releases) |
|
|
| From source | `cargo build --release` (needs a local Rust toolchain) |
|
|
|
|
Official extensions update independently of the CLI:
|
|
|
|
```text
|
|
marqdo ext add web
|
|
marqdo ext add quantum
|
|
```
|
|
|
|
`ext add` tries CDN https://ext.marqdo.com first, then GitHub, then the proxy mirror. See [`features/05-extensions.mq.md`](features/05-extensions.mq.md).
|