Markdown that runs.

Run the code blocks in a markdown file, like a notebook whose file format is plain markdown.

go install github.com/gdey/markdownshell/cmd/mdsh@latest

Get started View on GitHub

A notebook you can read anywhere

An mdsh document is an ordinary markdown file. Prose explains what each block does, the sh blocks run top to bottom, and the output lands right under the block that made it. It renders on GitHub, diffs cleanly in git, and runs from the command line.

#!/usr/bin/env mdsh
# Hello, mdsh

```sh {#setup}
export GREETING=hello
NAME=world
echo "$GREETING, $NAME"
```

Run mdsh -w hello.md and mdsh writes the result back into the file:

```output {for=setup exit=0}
hello, world
```

What it does

A banner drawn by an mdsh block

A terminal-style screenshot made by an mdsh block

Both images above were drawn by blocks in the hello example.