Bind `lang fences like formulas, run them via local interpreters, polish live-view code cards, and refresh bilingual welcome docs. Co-authored-by: Cursor <cursoragent@cursor.com>
56 lines
2.0 KiB
Markdown
56 lines
2.0 KiB
Markdown
---
|
||
title: Welcome to Marqdo
|
||
description: User docs home — code is documentation (English)
|
||
> lib/math.mq.md
|
||
> 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).
|
||
|
||
中文文档请看同目录的 [`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`!
|
||
|
||
---
|
||
|
||
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` = > 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.
|