patat

Terminal-based presentations using Pandoc

http://github.com/jaspervdj/patat

Version on this page:0.5.2.2
LTS Haskell 9.21:0.5.2.2
Stackage Nightly 2017-07-25:0.5.2.2
Latest on Hackage:0.12.0.0

See all snapshots patat appears in

GPL-2.0-only licensed and maintained by Jasper Van der Jeugt
This version can be pinned in stack with:patat-0.5.2.2@sha256:d3a6ea56e892d392c946e6bf887543fb9ea4927902281e5f4ccbd37758944055,2218

Module documentation for 0.5.2.2

There are no documented modules for this package.

patat

Build Status Hackage GitHub tag

patat (Presentations Atop The ANSI Terminal) is a small tool that allows you to show presentations using only an ANSI terminal. It does not require ncurses.

Features:

screenshot

Table of Contents

Installation

Pre-built-packages

There is a pre-built package available for Debian:

From source

Installation from source is very easy. You can build from source using stack install or cabal install. patat is also available from Hackage.

For people unfamiliar with the Haskell ecosystem, this means you can do either of the following:

Using stack

  1. Install stack for your platform.
  2. Clone this repository.
  3. Run stack setup (if you’re running stack for the first time) and stack install.
  4. Make sure $HOME/.local/bin is in your $PATH.

Using cabal

  1. Install cabal for your platform.
  2. Run cabal install patat.
  3. Make sure $HOME/.cabal/bin is in your $PATH.

Running

patat [*options*] file

Options

-w, --watch

: If you provide the --watch flag, patat will watch the presentation file for changes and reload automatically. This is very useful when you are writing the presentation.

-f, --force

: Run the presentation even if the terminal claims it does not support ANSI features.

-d, --dump

: Just dump all the slides to stdout. This is useful for debugging.

--version

: Display version information.

Controls

  • Next slide: space, enter, l, , PageDown
  • Previous slide: backspace, h, , PageUp
  • Go forward 10 slides: j,
  • Go backward 10 slides: k,
  • First slide: 0
  • Last slide: G
  • Reload file: r
  • Quit: q

The r key is very useful since it allows you to preview your slides while you are writing them. You can also use this to fix artifacts when the terminal is resized.

Input format

The input format can be anything that Pandoc supports. Plain markdown is usually the most simple solution:

---
title: This is my presentation
author: Jane Doe
...

# This is a slide

Slide contents.  Yay.

---

# Important title

Things I like:

- Markdown
- Haskell
- Pandoc

Horizontal rulers (---) are used to split slides.

However, if you prefer not use these since they are a bit intrusive in the markdown, you can also start every slide with a header. In that case, the file should not contain a single horizontal ruler.

patat will pick the most deeply nested header (e.g. h2) as the marker for a new slide. Headers above the most deeply nested header (e.g. h1) will turn into title slides, which are displayed as as a slide containing only the centered title.

This means the following document is equivalent to the one we saw before:

---
title: This is my presentation
author: Jane Doe
...

# This is a slide

Slide contents.  Yay.

# Important title

Things I like:

- Markdown
- Haskell
- Pandoc

And that following document contains three slides: a title slide, followed by two content slides.

---
title: This is my presentation
author: Jane Doe
...

# Chapter 1

## This is a slide

Slide contents.  Yay.

## Another slide

Things I like:

- Markdown
- Haskell
- Pandoc

For more information, see Advanced slide splitting.

Configuration

patat is fairly configurable. The configuration is done using YAML. There are two places where you can put your configuration:

  1. In the presentation file itself, using the Pandoc metadata header.
  2. In $HOME/.patat.yaml

For example, we set an option key to val by using the following file:

---
title: Presentation with options
author: John Doe
patat:
    key: val
...

Hello world.

Or we can use a normal presentation and have the following $HOME/.patat.yaml:

key: val

Line wrapping

Line wrapping can be enabled by setting wrap: true in the configuration. This will re-wrap all lines to fit the terminal width better.

Auto advancing

By setting autoAdvanceDelay to a number of seconds, patat will automatically advance to the next slide.

---
title: Auto-advance, yes please
author: John Doe
patat:
    autoAdvanceDelay: 2
...

Hello World!

---

This slide will be shown two seconds after the presentation starts.

Note that changes to autoAdvanceDelay are not picked up automatically if you are running patat --watch. This requires restarting patat.

Advanced slide splitting

You can control the way slide splitting works by setting the slideLevel variable. This variable defaults to the least header that occurs before a non-header, but it can also be explicitly defined. For example, in the following document, the slideLevel defaults to 2:

# This is a slide

## This is a nested header

This is some content

With slideLevel 2, the h1 will turn into a “title slide”, and the h2 will be displayed at the top of the second slide. We can customize this by setting slideLevel manually:

---
patat:
  slideLevel: 1
...

# This is a slide

## This is a nested header

This is some content

Now, we will only see one slide, which contains a nested header.

Fragmented slides

By default, slides are always displayed “all at once”. If you want to display them fragment by fragment, there are two ways to do that. The most common case is that lists should be displayed incrementally.

This can be configured by settings incrementalLists to true in the metadata block:

---
title: Presentation with incremental lists
author: John Doe
patat:
    incrementalLists: true
...

- This list
- is displayed
- item by item

Setting incrementalLists works on all lists in the presentation. To flip the setting for a specific list, wrap it in a block quote. This will make the list incremental if incrementalLists is not set, and it will display the list all at once if incrementalLists is set to true.

This example contains a sublist which is also displayed incrementally, and then a sublist which is displayed all at once (by merit of the block quote).

---
title: Presentation with incremental lists
author: John Doe
patat:
    incrementalLists: true
...

- This list
- is displayed

    * item
    * by item

- Or sometimes

    > * all at
    > * once

Another way to break up slides is to use a pagraph only containing three dots separated by spaces. For example, this slide has two pauses:

Legen

. . .

wait for it

. . .

Dary!

Theming

Colors and other properties can also be changed using this configuration. For example, we can have:

---
author: 'Jasper Van der Jeugt'
title: 'This is a test'
patat:
    wrap: true
    theme:
        emph: [vividBlue, onVividBlack, bold]
        imageTarget: [onDullWhite, vividRed]
...

# This is a presentation

This is _emph_ text.

![Hello](foo.png)

The properties that can be given a list of styles are:

blockQuote, borders, bulletList, codeBlock, code, definitionList, definitionTerm, emph, header, imageTarget, imageText, linkTarget, linkText, math, orderedList, quoted, strikeout, strong, tableHeader, tableSeparator

The accepted styles are:

bold, dullBlack, dullBlue, dullCyan, dullGreen, dullMagenta, dullRed, dullWhite, dullYellow, onDullBlack, onDullBlue, onDullCyan, onDullGreen, onDullMagenta, onDullRed, onDullWhite, onDullYellow, onVividBlack, onVividBlue, onVividCyan, onVividGreen, onVividMagenta, onVividRed, onVividWhite, onVividYellow, underline, vividBlack, vividBlue, vividCyan, vividGreen, vividMagenta, vividRed, vividWhite, vividYellow

Syntax Highlighting

As part of theming, syntax highlighting is also configurable. This can be configured like this:

---
patat:
  theme:
    syntaxHighlighting:
      decVal: [bold, onDullRed]
...

...

decVal refers to “decimal values”. This is known as a “token type”. For a full list of token types, see this list – the names are derived from there in an obvious way.

Trivia

“Patat” is the Flemish word for a simple potato. Dutch people also use it to refer to French Fries but I don’t really do that – in Belgium we just call fries “Frieten”.

The idea of patat is largely based upon MDP which is in turn based upon VTMC. I wanted to write a clone using Pandoc because I ran into a markdown parsing bug in MDP which I could not work around. A second reason to do a Pandoc-based tool was that I would be able to use Literate Haskell as well. Lastly, I also prefer not to install Node.js on my machine if I can avoid it.

Changes

Changelog

  • 0.5.2.2 (2017-06-14)

    • Add network-uri dependency to fix travis build
  • 0.5.2.1 (2017-06-14)

    • Bump optparse-applicative-0.14 dependency
  • 0.5.2.0 (2017-05-16)

    • Add navigation using PageUp and PageDown.
    • Use skylighting instead of deprecated highlighting-kate for syntax highlighting.
  • 0.5.1.2 (2017-04-26)

    • Make build reproducible even if timezone changes (patch by Félix Sipma)
  • 0.5.1.1 (2017-04-23)

    • Include README in Extra-source-files so it gets displayed on Hackage
  • 0.5.1.0 (2017-04-23)

    • Bump aeson-1.2 dependency
    • Fix vertical alignment of title slides
    • Fix wrapping issue with inline code at end of line
    • Add bash-completion script generation to Makefile
  • 0.5.0.0 (2017-02-06)

    • Add a slideLevel option & autodetect it. This changes the way patat splits slides. For more information, see the README or the man page. If you just want to get the old behavior back, just add:

        ---
        patat:
          slideLevel: 1
        ...
      

      To the top of your presentation.

    • Clear the screen when finished with the presentation.

  • 0.4.7.1 (2017-01-22)

    • Bump directory-1.3 dependency
    • Bump time-1.7 dependency
  • 0.4.7.0 (2017-01-20)

    • Bump aeson-1.1 dependency
    • Parse YAML for settings using yaml instead of pandoc
    • Clarify watch & autoAdvance combination in documentation.
  • 0.4.6.0 (2016-12-28)

    • Redraw the screen on unknown commands to prevent accidental typing from showing up.
    • Make the cursor invisible during the presentation.
    • Move the footer down one more line to gain some screen real estate.
  • 0.4.5.0 (2016-12-05)

    • Render the date in a locale-independent manner (patch by Daniel Shahaf).
  • 0.4.4.0 (2016-12-03)

    • Force the use of UTF-8 when generating the man page.
  • 0.4.3.0 (2016-12-02)

    • Use SOURCE_DATE_EPOCH if it is present instead of getting the date from git log.
  • 0.4.2.0 (2016-12-01)

    • Fix issues with man page generation on Travis.
  • 0.4.1.0 (2016-12-01)

    • Fix compatibility with pandoc-1.18 and pandoc-1.19.
    • Add a man page.
  • 0.4.0.0 (2016-11-15)

    • Add configurable auto advancing.
    • Support fragmented slides.
  • 0.3.3.0 (2016-10-31)

    • Add a --version flag.
    • Add support for pandoc-1.18 which includes a new LineBlock element.
  • 0.3.2.0 (2016-10-20)

    • Keep running even if errors are encountered during reload.
  • 0.3.1.0 (2016-10-18)

    • Fix compilation with lts-6.22.
  • 0.3.0.0 (2016-10-17)

    • Add syntax highlighting support.
    • Fixed slide clipping after reload.
  • 0.2.0.0 (2016-10-13)

    • Add theming support.
    • Fix links display.
    • Add support for wrapping.
    • Allow org mode as input format.
  • 0.1.0.0 (2016-10-02)

    • Upload first version from hotel wifi in Kalaw.