# markdown-based scripting language

Code lives in
your docs.

MDCode turns markdown heading syntax into executable scripts. Every # is a command. Readable by anyone, runnable by everything.

$ curl -fsSL https://raw.githubusercontent.com/jhu7600codes/mdcode/main/install.sh | bash
View on GitHub →
hello.md
#import lib-mdcode
#import lib-autoVar

#var name (create) | MDCode
#print | Hello from + name | !

#env HOME > homeDir
#print | Running from: + homeDir

#os | uname -r > kernel
###print | Kernel: + kernel

#exit | 0

Why MDCode

Scripting that reads like docs.

#
Heading syntax
Commands are markdown headings. Depth increases by +2 per level. Anyone can read it without knowing the language.
|
Explicit literals
Strings, numbers and booleans use |. Bare words are always variables. No ambiguity, ever.
/
Unix-style piping
Chain commands with / just like the shell. Pipe output directly into the next command's input.
lib
Library system
Import lib-autoVar for automatic variable passing. Import lib-visual for native GUI windows.
>
Scoped variables
Regular vars live globally. onetimeVars are block-scoped and only accessible at the right depth — by design.
py
Pure Python
Single file interpreter, stdlib only. No dependencies to install. Works anywhere Python 3.10+ is available.

Guide

Learn MDCode in 5 steps.

01 Commands & depth

Every line starts with #. The number of # symbols defines nesting depth, incrementing by +2 per level. ## is special — it accesses onetimeVars from the parent block.

#print | top level
###print | child of above
#####print | child of child
##print | accesses parent onetimeVar
02 Arguments: strings, vars, concat

| starts a literal value. A bare word is a variable. Use + to concatenate anything.

#print | hello world          ← string
#print myVar                 ← variable
#print | hello + userName    ← str + var
#print vr + | it worked      ← var + str
03 Assignment & piping

Use > to store output. Use / to pipe output into the next command. Pipes chain.

#os | uname -r > kernel
#print | kernel: + kernel

#print | y / input | continue?
04 Variables & onetimeVars

Create or edit vars with #var. onetimeVars are block-scoped — only accessible one level deeper via ##.

#var greeting (create) | hello
#var greeting (edit) | goodbye

#var data (change) type > onetimeVar
##print | data: + data
05 Libraries

lib-mdcode is the core, always import it. lib-autoVar auto-exposes strVar and log vars. lib-visual builds native GTK windows with navbar and webview.

#import lib-mdcode
#import lib-autoVar

#readFile | ~/.config/hypr.log
##print strVar

#import lib-visual
#visual | My App
###topbar
#####navbar | (button) Home (gotoWeb) https://example.com
#######webview | https://example.com

Get MDCode

One command install.

$ curl -fsSL https://raw.githubusercontent.com/jhu7600codes/mdcode/main/install.sh | bash
$ mdcode run yourfile.md

requires python 3.10+ — no pip installs needed