#bash #mdbook #tutorial #preprocessor #markdown #build-time

bin+lib mdbook-bash-tutorial

A mdbook preprocessor that allows embedding Bash scripts as tutorials

2 releases

0.1.6 Oct 3, 2023
0.1.5 Jun 26, 2023

#1126 in Text processing

43 downloads per month

MIT/Apache

20KB
330 lines

mdbook bash tutorial

⚠️ this preprocessor is not production ready, use it with caution ⚠️

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.

Example

  1. chapter-1.md
    # Chapter 1
    
    {{#tutorial ./example/bash-script.sh}}
    
  2. example/bash-script.sh
    #!/bin/bash
    
    ## Title
    echo "command"
    sleep 1000  # mdbash: skip-line
    
    ## Title-2
    echo "command-2"
    
  3. Built chapter
    # Chapter 1
    
    1. Title
    ```console
    echo "command"
    ```
    2. Title-2
    ```console
    echo "command-2"
    ```
    

Dependencies

~12–23MB
~330K SLoC