GithubHelp home page GithubHelp logo

slide.sh's Introduction

slide.sh

Spend less time making slides

""

What is it?

slide.sh is a small, basic, kludgy, hackish, ghetto slide maker that will execute entirely inside of your shell.

There are no graphics, no transitions or effects, no cool line drawing abilities, or anything like that. Seriously bro, its a shell script.

Purpose

slide.sh began as an experiment in what the bash shell is capable of all on its own, and attempts to do something cool without assuming that there are a slew of commands at your disposal. There only requirement outside of bash itself is the tput command, since bash doesn't provide the needed capabilities to move the cursor about the screen freely.

Functionality

What slide.sh provides is the ability to show simulated pages of ASCII text inside of your terminal. An advantage to this is that you, as some sort of programmer, won't have to take a bunch of screen caps or copy / paste text into some full-featured slide creation program to demo the core functionality of your executable program in a clean and organized way while notating certain things and controlling the flow of your presentation.

Features

  • Pre-formatted text will render exactly as it was produced
  • Text centering for writing titles, page markers, etc.
  • Slide pausing to help demonstrate multi-step processes
  • Slide separators (horizontal rule)

Uses

Some useful things I've done with slide.sh / can think of for it:

  • Demo REST API calls using cURL
  • Demo command-line tool functionality
  • Write some markdown-style slides for basic presentations
  • Share slides with people in a screen session

Requirements

  • A bash shell
  • tput

Example

The above demo was created from the following shell script, which just sources slide.sh and then makes some slides.

#!/bin/bash
source ./slide.sh

slide <<EOF
!!center
<green>slide.sh<end>

Spend less time making slides
https://github.com/ryanuber/slide.sh
EOF

slide <<EOF
By default, text appears exactly as you entered it.
EOF

slide <<EOF
!!center
Centering Text

In any of your slides, you can insert a line that reads '!!center'. This
will cause text in the following lines to be centered.

!!nocenter
You can use '!!nocenter' at any time to stop centering lines
EOF

slide <<EOF
!!center
You can use backticks or dollar-parenthesis to execute commands inside
of the slide, like this:

Today is \$(date +%A)

evaluates to...

Today is $(date +%A)
EOF

slide <<EOF
!!center
You can also use variables for repetetive information, like this:

The current working directory is \$PWD

evaluates to...

The current working directory is $PWD
EOF

slide 'Check out this custom action message' <<EOF
!!center
You can pass a string argument to 'slide' to define a custom action message,
rather than the default 'next slide' message.
EOF

slide <<EOF
You can add pauses inside of each slide for demonstrating things. You can
advance slide rendering by pressing return. For example, in this slide, there
should be a pause immediately after this sentence.
!!pause
Did it pause? Cool! It should pause one more time following this sentence.
!!pause
You can use !!pause as many times as you'd like.
EOF

slide <<EOF
!!center
Separators

You can separate parts of a slide by using '!!sep' on a line of its own.
!!sep
It is useful for packing multiple thoughts or ideas into a single slide.
!!sep
You could also use it to create a separated header at the top of each slide.
You can add as many separators as you want.
EOF

slide <<EOF
!!center
<red>C<green>o<yellow>l<blue>o<purple>r<end>

slide.sh supports a number of color options:
!!nocenter
    <red>red<end>
    <green>green<end>
    <blue>blue<end>
    <cyan>cyan<end>
    <yellow>yellow<end>
    <purple>purple<end>

!!center
!!nocolor
You can use !!nocolor to disable colors, and !!color to re-enable it later.

Colors are invoked using "<colorname>". So for example, <red> would give you red
text until the next <colorname> or <end> is encountered.
EOF

slide 'Only one more slide to go! ->' <<EOF
!!center

<cyan>Putting it all together<end>
<green>!!sep<end>

This slide demonstrates all of the functionality working together.
!!pause


I'll show you the time from a few different places around the world.
!!pause
!!nocenter

!!sep
   California      $(TZ=America/Los_Angeles date)
   Panama          $(TZ=America/Panama date)
   Virgin Islands  $(TZ=America/Virgin date)
   Tahiti          $(TZ=Pacific/Tahiti date)
   Athens          $(TZ=Europe/Athens date)
!!sep

!!pause

!!center
Putting slides together is super-fast and easy!
EOF

slide 'End of slides - Press enter to quit' <<EOF
!!center
...And that's all you need to know!
EOF

slide.sh's People

Contributors

ryanuber avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.