..

Terminal-Based Presentation

back

  • Diagram Tools


Slides

Slides is a terminal-based tool that brings the art of presentations straight to the console1. Let’s explore how to get started and maximize this tool!

installation...

Here’s how you can install it:

  • MacOS: brew install slides.
  • Golang: go install github.com/maaslalani/slides@latest.
  • from source:
    git clone https://github.com/maaslalani/slides.git
    cd slides
    go install
    

example...

Here’s a quick glimpse of what Slides can do:

  ---
  author: Igor Lima
  date: MMMM dd, YYYY
  paging: Slide %d / %d
  ---

  # Welcome to Slides
  A terminal-based presentation tool
  
  ---
  
  ## Everything is markdown
  This entire presentation is a markdown file.
  
  ---
  
  ## Everything happens in your terminal
  Create slides and present them without ever leaving your terminal.
  
  ---
  
  ## Code execution
  ```go
  package main
  
  import "fmt"
  
  func main() {
    fmt.Println("Execute code directly inside the slides")
  }
  ```
  
  You can execute code inside your slides by pressing `<C-e>`, and the output will appear at the end of the current slide.
  
  ---
  
  ## Pre-process slides
  
  Add a code block with three tildes (`~`) to run a command *before* displaying the slides. The text inside the block is passed as `stdin` to the command, and it gets replaced with the command's `stdout`.
  
  ```txt
  ~~~graph-easy --as=boxart
  [ A ] - to -> [ B ]
  ~~~
  ```
  
  The above will transform into:
  
  ```txt
  ┌───┐  to   ┌───┐
  │ A │ ────> │ B │
  └───┘       └───┘
  ```
  
  For security, ensure the file has execution permissions. Use `chmod` to set this up:
  
  ```bash
  chmod +x file.md
  ```

To start the presentation, run:

  • slides presentation.md
  • curl http://example.com/slides.md | slides

Enjoy creating and sharing presentations easily on the terminal!

references...



Other Tools

  • Graph-Easy: a CLI Tool for Rendering diagrams in Terminal

    The graph-easy tool is an utility that can render and convert graphs in various formats. Its ability to create diagrams directly in the terminal using ASCII art is fascinating. Additionally, it can convert and render graphs in formats like HTML, SVG, PNG, and so forth.

    This tool is crafted in Perl and can be installed via CPAN.

    • installation instructions
      1. download and extract:

        # https://metacpan.org/pod/Graph::Easy
        # https://metacpan.org/pod/Graph::Easy::As_svg
        # https://github.com/shlomif/Graph-Easy-As_svg
        # https://metacpan.org/dist/Graph-Easy
        curl -O https://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/Graph-Easy-0.76.tar.gz
        tar -xzf Graph-Easy-0.76.tar.gz
        cd Graph-Easy-0.76
        
      2. build and test:

        perl Makefile.PL
        make test
        
      3. install the package (as root):

        sudo make install
        

    • SVG rendering setup

      For rendering diagrams as SVG, an additional package is required. Here’s how to install it:

      1. install the SVG package:

        # http://bloodgate.com/perl/graph/
        # https://metacpan.org/pod/Graph::Easy#as_svg()
        perl -MCPAN -e 'shell'
        > install Graph::Easy::As_svg
        > q
        
      2. try rendering an SVG:

       # https://linux.die.net/man/1/graph-easy
       # https://metacpan.org/dist/Graph-Easy/view/bin/graph-easy
       echo "[ Bonn ] - car -> [ Berlin ]" | graph-easy --as=svg --output=output.svg
      

    • rendering examples

      Once you have the package installed, you can give it a go with rendering simple graphs:

      1. render as ASCII:

        echo "[ Bonn ] - car -> [ Berlin ]" | graph-easy
        
        +------+  car   +--------+
        | Bonn | -----> | Berlin |
        +------+        +--------+
        
      2. render as PNG:

        echo "[ Bonn ] - car -> [ Berlin ]" | graph-easy --as=png
        open graph.png
        


  • PlantUML: another CLI Tool for rendering diagrams (but not in terminal)

    PlantUML is a tool used to create a wide variety of diagrams with a simple language. It’s useful for generating diagrams in ASCII format for display in terminals. With PlantUML, you can create UML diagrams, sequence diagrams, flowcharts, and more.

    References...
    How to run and use PlantUML locally...

    To get started with PlantUML locally, run the PlantUML server container using Docker:

    # run the PlantUML server container
    docker run \
      -d --name plant-uml --rm \
      -p 3005:8080 \
      plantuml/plantuml-server:jetty
      
    # stop the container when you're done
    docker ps
    docker stop [CONTAINER_ID]
    docker stop plant-uml
    

    Examples...

    PlantUML is a tool that makes diagramming easy.