The examples tour

The fastest way to see what mdsh does is to run it. The repository’s examples/ folder is a tour in nine parts, from a two-block hello to whole runbooks, and every part has a Try it block that runs the example it describes.

Open it

git clone https://github.com/gdey/markdownshell
cd markdownshell/examples
mdsh-gui .          # the desktop app's start screen, for this folder
mdsh -i             # or the same in the terminal

The start screen shows the tour as a collection, and fifo/ and runbooks/ as collections of their own, each with a title, icon and color from the .mdsh.yaml in its folder. The ⚙ beside a folder edits that file in a form. Pin the files you come back to; they stay at the top.

The start screen on the examples folder: pinned and recent files, then the tour as a collection.
The start screen on the examples folder: pinned and recent files, then the tour as a collection.
The start screen on the examples folder: pinned and recent files, then the tour as a collection.

Open README.md first. It is the tour itself, and an mdsh document too: each Try it block is marked skip, so Run all leaves them alone, and picking one runs it. Everything also works from the command line:

mdsh hello.md                 # run it and print the document with fresh output
./hello.md                    # the same, through the shebang
mdsh -w hello.md              # run it and write the output back
mdsh --pdf hello.pdf hello.md # the run, as a PDF

The nine parts

PartFileWhat it shows
1hello.mdBlocks that share a shell, sub-envs with share=, out=markdown tables, out=image and out=screenshot, an mdsh:if section, placeholders in the prose
2include.mdA block that quotes lines from another file and keeps the quote current
3guardrails.mdon_error: stop, run=once, confirm, depends=, timeout=, skip, and an output copy at the end
4inputs.mdtextbox and choice blocks with var=, mdsh ctl set, and sections that open folded
5terminal.mdtty blocks on a real terminal, recorded as GIFs, and tapes that type for them
6fifo/background blocks handing data through a named pipe, and a timeout= that saves a hung run
7report.mdA document written to be read as a PDF or HTML report
8history.mdWhat a History session leaves behind
9runbooks/Whole runbooks: deploy, release, onboarding, disk and system reports, triage, test coverage

Things to try

Ship the site, carefully. Open runbooks/deploy.md and press Run all. It builds a small site, checks its links in the background while it measures it, and stops to ask before it ships. Everything happens in a scratch directory, so it is safe anywhere.

The deploy runbook waiting at its confirm block.
The deploy runbook waiting at its confirm block.
The deploy runbook waiting at its confirm block.

Watch the dependencies. In guardrails.md, select the deploy block. Lines in the margin run up to the login and fetch blocks it names in depends=. Run deploy alone and mdsh asks to run login first.

A block's `depends=`, drawn as lines in the margin.
A block's `depends=`, drawn as lines in the margin.
A block’s depends=, drawn as lines in the margin.

Fill in a form. inputs.md has a host name, an environment and a set of checks. Change them in the app and run the section: the blocks below follow what you picked, and the file keeps it.

Make a report. File › Create Report… on report.md, or from a terminal:

mdsh --pdf report.pdf report.md
mdsh --html report.html --hide-code report.md

Start your own. New Session on the start screen opens a file named for the day with the History pane ready. Type commands; each one lands in the file as a block with its output.

A session file: commands typed into the History pane at the bottom become blocks above.
A session file: commands typed into the History pane at the bottom become blocks above.
A session file: commands typed into the History pane at the bottom become blocks above.

Where each feature is shown

The tour’s own README has a full table of which example shows which attribute and flag: examples/README.md. The use cases pages show three of the runbooks with the reports one run of them made.