Bare tables in a function body evaluate as collections without requiring a name bind; restores welcome-page install tables. Co-authored-by: Cursor <cursoragent@cursor.com>
75 lines
2.6 KiB
Markdown
75 lines
2.6 KiB
Markdown
---
|
||
title: Welcome to Marqdo
|
||
description: User docs home — code is documentation (English)
|
||
import math:lib/math.mq.md
|
||
import foreign:lib/foreign.mq.md
|
||
---
|
||
|
||
# main
|
||
|
||
Hi — thanks for reading this far. I am Marqdo’s developer. Marqdo is a language where *code is documentation, and documentation is code*: Markdown markers are the program structure, so what you read is what runs.
|
||
|
||
AI already prefers Markdown-shaped output. The idea was: why keep docs and code as two separate worlds? So Marqdo was born as a “docs are code” language. To keep every source renderable as Markdown, files use the `.mq.md` suffix. From early on we aimed for richer tooling — auto-generated YAML for OKF-style knowledge bases, even auto-generated slides — those are later goals. Happily, it already works well as a blogging tool: yes, this site is generated by Marqdo. And when AI writes Marqdo, you tend to burn fewer tokens — wallets everywhere thank you.
|
||
|
||
The language is still young: structure markers, bilingual core names (`print` / `打印`, …), importable stdlibs (see [`stdlib/`](stdlib/) on this site), local `view`, and static export. Contribute on [GitHub](https://github.com/cflmy/marqdo).
|
||
|
||
## Install
|
||
|
||
Pick one way to get the CLI:
|
||
|
||
| Method | Notes |
|
||
|--------|-------|
|
||
| Ubuntu PPA | `sudo add-apt-repository ppa:cflmy/marqdo` then `sudo apt install marqdo` |
|
||
| GitHub Releases | Prebuilt Windows / Linux zips at [releases](https://github.com/cflmy/marqdo/releases) |
|
||
| From source | `cargo build --release` (needs Rust) |
|
||
|
||
Official extensions version 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).
|
||
|
||
中文文档请看同目录的 [`00-欢迎.mq.md`](00-欢迎.mq.md)(叙述与内置均用中文)。
|
||
|
||
A small function to say hello:
|
||
|
||
> greet who=marqdo
|
||
|
||
Named args can include spaces:
|
||
|
||
> greet who=marqdo user
|
||
|
||
## greet
|
||
+ `who`
|
||
|
||
> print text=Welcome, `who`!
|
||
|
||
*None*
|
||
|
||
Beyond the basics above, Marqdo also ships standard libraries: table, time, text, files, system, math, foreign, and more.
|
||
|
||
Math and foreign deserve a special mention. With the math library you can bind a formula like this:
|
||
|
||
`f` =
|
||
$$
|
||
x^2 - 2
|
||
$$
|
||
|
||
Then plot it:
|
||
|
||
**`_svg` = > math.plot formula=`f` var="x" min=-3 max=3**
|
||
|
||
The foreign library lets you call external code, for example:
|
||
|
||
`hi` =
|
||
```python
|
||
print("hello-from-python")
|
||
```
|
||
|
||
Under Markdown this stays easy to read — which is the point: Marqdo’s design is code as documentation, documentation as code.
|
||
|
||
Welcome again — enjoy exploring Marqdo.
|