The Bash Tutorial mdbook preprocessor allows you to import a Bash script in your book. Scripts remain easily testable and are embedded in the book at build time.
chapter-1.md
# Chapter 1 {{#tutorial ./example/bash-script.sh}}
example/bash-script.sh
#!/bin/bash ## Title echo "command" sleep 1000 # mdbash: skip-line ## Title-2 echo "command-2"
- Built chapter
# Chapter 1 1. Title ```console echo "command" ``` 2. Title-2 ```console echo "command-2" ```