Build three terminal slides from Markdown

Create a three-slide Markdown deck for presenterm, add a code block, and navigate it in a terminal.

how-to3 steps

Updated

in short

Write Markdown separated by end_slide comments, then open the file with presenterm. Code blocks are displayed as text unless execution is explicitly enabled.

Use the small fixture below to check the workflow before applying it to your own project.

Tools used

Before you start

  • A Bash or Zsh terminal on Linux or macOS
  • The listed tools installed and available on PATH

Steps

  1. Step 1: Write the deck

    The HTML comments below are slide commands, not visible slide text.

    sh
    trmn_guide_dir="$(mktemp -d)"
    cd "$trmn_guide_dir"
    cat > demo.md <<'EOF'
    # A small terminal demo
    
    Three slides from one Markdown file.
    
    <!-- end_slide -->
    
    # A command to discuss
    
    ```sh
    printf 'hello from a slide\n'
    ```
    
    <!-- end_slide -->
    
    # Next step
    
    - Adapt the deck for your project.
    - Keep code examples short.
    EOF
  2. Step 2: Open the presentation

    Run this in an interactive terminal. Keep snippet execution disabled for this example.

    sh
    presenterm demo.md
  3. Step 3: Navigate and quit

    Use the right and left arrow keys to move between slides. Press q to quit. If content is clipped, enlarge the terminal or shorten the slide.

Further reading

[presenterm documentation](https://mfontanini.github.io/presenterm/) · [Slide commands](https://mfontanini.github.io/presenterm/features/commands.html)

FAQ

Will the code block run?
Not in this example. Do not add the snippet-execution flags when you only want to display code.
Do I need an image protocol?
This deck contains text only. Image support is a separate terminal capability.

related