.\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "patat manual" "1" "February 25, 2024" "patat v0.11.0.0" "" .hy .SH NAME .PP patat - Presentations Atop The ANSI Terminal .SH SYNOPSIS .PP \f[V]patat [*options*] file\f[R] .SH DESCRIPTION .SS Controls .IP \[bu] 2 \f[B]Next slide\f[R]: \f[V]space\f[R], \f[V]enter\f[R], \f[V]l\f[R], \f[V]→\f[R], \f[V]PageDown\f[R] .IP \[bu] 2 \f[B]Previous slide\f[R]: \f[V]backspace\f[R], \f[V]h\f[R], \f[V]←\f[R], \f[V]PageUp\f[R] .IP \[bu] 2 \f[B]Go forward 10 slides\f[R]: \f[V]j\f[R], \f[V]↓\f[R] .IP \[bu] 2 \f[B]Go backward 10 slides\f[R]: \f[V]k\f[R], \f[V]↑\f[R] .IP \[bu] 2 \f[B]First slide\f[R]: \f[V]0\f[R] .IP \[bu] 2 \f[B]Last slide\f[R]: \f[V]G\f[R] .IP \[bu] 2 \f[B]Jump to slide N\f[R]: \f[V]N\f[R] followed by \f[V]enter\f[R] .IP \[bu] 2 \f[B]Reload file\f[R]: \f[V]r\f[R] .IP \[bu] 2 \f[B]Quit\f[R]: \f[V]q\f[R] .PP The \f[V]r\f[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. .SS Input format .PP The input format can be anything that Pandoc supports. Plain markdown is usually the most simple solution: .IP .nf \f[C] --- title: This is my presentation author: Jane Doe \&... # This is a slide Slide contents. Yay. --- # Important title Things I like: - Markdown - Haskell - Pandoc \f[R] .fi .PP Horizontal rulers (\f[V]---\f[R]) are used to split slides. .PP 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. .PP \f[V]patat\f[R] will pick the most deeply nested header (e.g.\ \f[V]h2\f[R]) as the marker for a new slide. Headers \f[I]above\f[R] the most deeply nested header (e.g.\ \f[V]h1\f[R]) will turn into title slides, which are displayed as as a slide containing only the centered title. .PP This means the following document is equivalent to the one we saw before: .IP .nf \f[C] --- title: This is my presentation author: Jane Doe \&... # This is a slide Slide contents. Yay. # Important title Things I like: - Markdown - Haskell - Pandoc \f[R] .fi .PP And that following document contains three slides: a title slide, followed by two content slides. .IP .nf \f[C] --- 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 \f[R] .fi .PP For more information, see Advanced slide splitting. .SS Configuration .PP \f[V]patat\f[R] is fairly configurable. The configuration is done using YAML (http://yaml.org/). There are several places where you can put your configuration. .IP "1." 3 For per-user configuration you can use \f[V]$XDG_CONFIG_DIRECTORY/patat/config.yaml\f[R] (typically \f[V]$HOME/.config/patat/config.yaml\f[R]) or \f[V]$HOME/.patat.yaml\f[R], for example: .RS 4 .IP .nf \f[C] slideNumber: false \f[R] .fi .RE .IP "2." 3 In the presentation file itself, using the Pandoc metadata header (http://pandoc.org/MANUAL.html#extension-yaml_metadata_block). These settings take precedence over anything specified in the per-user configuration file. They must be placed in a \f[V]patat:\f[R] section, so they don\[cq]t conflict with metadata: .RS 4 .IP .nf \f[C] --- title: Presentation with options author: John Doe patat: slideNumber: false \&... Hello world. \f[R] .fi .RE .IP "3." 3 Within a slide, using a comment starting with \f[V] Slide numbers are turned off here. \f[R] .fi .PP The following settings can \f[B]not\f[R] be set in a slide configuration block, and doing so will result in an error: .IP \[bu] 2 \f[V]autoAdvanceDelay\f[R] .IP \[bu] 2 \f[V]eval\f[R] .IP \[bu] 2 \f[V]images\f[R] .IP \[bu] 2 \f[V]incrementalLists\f[R] .IP \[bu] 2 \f[V]pandocExtensions\f[R] .IP \[bu] 2 \f[V]slideLevel\f[R] .IP \[bu] 2 \f[V]speakerNotes\f[R] .RE .SS Line wrapping .PP Line wrapping can be enabled by setting \f[V]wrap: true\f[R] in the configuration. This will re-wrap all lines to fit the terminal width better. You can also ask patat to wrap at a specific column using e.g.\ \f[V]wrap: 60\f[R]. .SS Margins .PP Margins can be enabled by setting a \f[V]margins\f[R] entry in the configuration: .IP .nf \f[C] --- title: Presentation with margins author: John Doe patat: wrap: true margins: left: 10 right: 10 top: 5 \&... Lorem ipsum dolor sit amet, ... \f[R] .fi .PP This example configuration will generate slides with a margin of 10 columns on the left, and it will wrap long lines 10 columns before the right side of the terminal. Additionally, there will be 5 empty lines in between the title bar and slide content. .PP Line wrapping should be enabled when using non-zero \f[V]right\f[R] margin. .PP By default, the \f[V]left\f[R] and \f[V]right\f[R] margin are set to 0, and the \f[V]top\f[R] margin is set to 1. .SS Centering .PP To vertically center content, use \f[V]top: auto\f[R]. To horizontally center content, use both \f[V]left: auto\f[R] and \f[V]right: auto\f[R]. For example: .IP .nf \f[C] --- title: Centered presentation author: John Doe patat: margins: left: auto right: auto top: auto \&... Hello world \f[R] .fi .PP Line wrapping is recommended when vertically centering content if there are any lines that are too wide for the terminal. .SS Auto advancing .PP By setting \f[V]autoAdvanceDelay\f[R] to a number of seconds, \f[V]patat\f[R] will automatically advance to the next slide. .IP .nf \f[C] --- title: Auto-advance, yes please author: John Doe patat: autoAdvanceDelay: 2 \&... Hello World! --- This slide will be shown two seconds after the presentation starts. \f[R] .fi .PP Note that changes to \f[V]autoAdvanceDelay\f[R] are not picked up automatically if you are running \f[V]patat --watch\f[R]. This requires restarting \f[V]patat\f[R]. .SS Advanced slide splitting .PP You can control the way slide splitting works by setting the \f[V]slideLevel\f[R] 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 \f[V]slideLevel\f[R] defaults to \f[B]2\f[R]: .IP .nf \f[C] # This is a slide ## This is a nested header This is some content \f[R] .fi .PP With \f[V]slideLevel\f[R] 2, the \f[V]h1\f[R] will turn into a \[lq]title slide\[rq], and the \f[V]h2\f[R] will be displayed at the top of the second slide. We can customize this by setting \f[V]slideLevel\f[R] manually: .IP .nf \f[C] --- patat: slideLevel: 1 \&... # This is a slide ## This is a nested header This is some content \f[R] .fi .PP Now, we will only see one slide, which contains a nested header. .SS Fragmented slides .PP By default, slides are always displayed \[lq]all at once\[rq]. 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. .PP This can be configured by settings \f[V]incrementalLists\f[R] to \f[V]true\f[R] in the metadata block: .IP .nf \f[C] --- title: Presentation with incremental lists author: John Doe patat: incrementalLists: true \&... - This list - is displayed - item by item \f[R] .fi .PP Setting \f[V]incrementalLists\f[R] works on \f[I]all\f[R] 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 \f[V]incrementalLists\f[R] is not set, and it will display the list all at once if \f[V]incrementalLists\f[R] is set to \f[V]true\f[R]. .PP 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). .IP .nf \f[C] --- title: Presentation with incremental lists author: John Doe patat: incrementalLists: true \&... - This list - is displayed * item * by item - Or sometimes > * all at > * once \f[R] .fi .PP 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: .IP .nf \f[C] Legen \&. . . wait for it \&. . . Dary! \f[R] .fi .SS Theming .PP Colors and other properties can also be changed using this configuration. For example, we can have: .IP .nf \f[C] --- author: \[aq]Jasper Van der Jeugt\[aq] title: \[aq]This is a test\[aq] patat: wrap: true theme: emph: [vividBlue, onVividBlack, italic] strong: [bold] imageTarget: [onDullWhite, vividRed] \&... # This is a presentation This is _emph_ text. ![Hello](foo.png) \f[R] .fi .PP The properties that can be given a list of styles are: .PP \f[V]blockQuote\f[R], \f[V]borders\f[R], \f[V]bulletList\f[R], \f[V]codeBlock\f[R], \f[V]code\f[R], \f[V]definitionList\f[R], \f[V]definitionTerm\f[R], \f[V]emph\f[R], \f[V]header\f[R], \f[V]imageTarget\f[R], \f[V]imageText\f[R], \f[V]linkTarget\f[R], \f[V]linkText\f[R], \f[V]math\f[R], \f[V]orderedList\f[R], \f[V]quoted\f[R], \f[V]strikeout\f[R], \f[V]strong\f[R], \f[V]tableHeader\f[R], \f[V]tableSeparator\f[R], \f[V]underline\f[R] .PP The accepted styles are: .PP \f[V]bold\f[R], \f[V]italic\f[R], \f[V]dullBlack\f[R], \f[V]dullBlue\f[R], \f[V]dullCyan\f[R], \f[V]dullGreen\f[R], \f[V]dullMagenta\f[R], \f[V]dullRed\f[R], \f[V]dullWhite\f[R], \f[V]dullYellow\f[R], \f[V]onDullBlack\f[R], \f[V]onDullBlue\f[R], \f[V]onDullCyan\f[R], \f[V]onDullGreen\f[R], \f[V]onDullMagenta\f[R], \f[V]onDullRed\f[R], \f[V]onDullWhite\f[R], \f[V]onDullYellow\f[R], \f[V]onVividBlack\f[R], \f[V]onVividBlue\f[R], \f[V]onVividCyan\f[R], \f[V]onVividGreen\f[R], \f[V]onVividMagenta\f[R], \f[V]onVividRed\f[R], \f[V]onVividWhite\f[R], \f[V]onVividYellow\f[R], \f[V]underline\f[R], \f[V]vividBlack\f[R], \f[V]vividBlue\f[R], \f[V]vividCyan\f[R], \f[V]vividGreen\f[R], \f[V]vividMagenta\f[R], \f[V]vividRed\f[R], \f[V]vividWhite\f[R], \f[V]vividYellow\f[R] .PP Also accepted are styles of the form \f[V]rgb#RrGgBb\f[R] and \f[V]onRgb#RrGgBb\f[R], where \f[V]Rr\f[R] \f[V]Gg\f[R] and \f[V]Bb\f[R] are hexadecimal bytes (e.g.\ \f[V]rgb#f08000\f[R] for an orange foreground, and \f[V]onRgb#101060\f[R] for a deep purple background). Naturally, your terminal needs to support 24-bit RGB for this to work. When creating portable presentations, it might be better to stick with the named colours listed above. .SS Syntax Highlighting .PP \f[V]patat\f[R] uses Kate (https://kate-editor.org/) Syntax Highlighting files. \f[V]patat\f[R] ships with support for nearly one hundred languages thanks to Pandoc. However, if your language is not yet available, you can add the highlighting XML file in the settings: .IP .nf \f[C] --- patat: syntaxDefinitions: - \[aq]impurescript.xml\[aq] \&... \&... \f[R] .fi .PP As part of theming, syntax highlighting is also configurable. This can be configured like this: .IP .nf \f[C] --- patat: theme: syntaxHighlighting: decVal: [bold, onDullRed] \&... \&... \f[R] .fi .PP \f[V]decVal\f[R] refers to \[lq]decimal values\[rq]. This is known as a \[lq]token type\[rq]. For a full list of token types, see this list (https://hackage.haskell.org/package/highlighting-kate-0.6.3/docs/Text-Highlighting-Kate-Types.html#t:TokenType) \[en] the names are derived from there in an obvious way. .PP Note that in order to get syntax highlighting to work, you should annotate code blocks with the language, e.g.\ using a fenced code block: .IP .nf \f[C] \[ga]\[ga]\[ga]ruby puts \[dq]Hello, world!\[dq] \[ga]\[ga]\[ga] \f[R] .fi .SS Pandoc Extensions .PP Pandoc comes with a fair number of extensions on top of markdown, listed here (https://hackage.haskell.org/package/pandoc-2.0.5/docs/Text-Pandoc-Extensions.html). .PP \f[V]patat\f[R] enables a number of them by default, but this is also customizable. .PP In order to enable an additional extensions, e.g.\ \f[V]autolink_bare_uris\f[R], add it to the \f[V]pandocExtensions\f[R] field in the YAML metadata: .IP .nf \f[C] --- patat: pandocExtensions: - patat_extensions - autolink_bare_uris \&... Document content... \f[R] .fi .PP The \f[V]patat_extensions\f[R] in the above snippet refers to the default set of extensions enabled by \f[V]patat\f[R]. If you want to disable those and only use a select few extensions, simply leave it out and choose your own: .IP .nf \f[C] --- patat: pandocExtensions: - autolink_bare_uris - emoji \&... Document content... \f[R] .fi .PP If you don\[cq]t want to enable any extensions, simply set \f[V]pandocExtensions\f[R] to the empty list \f[V][]\f[R]. .SS Images .SS Native Images support .PP \f[V]patat-0.8.0.0\f[R] and newer include images support for some terminal emulators. .IP .nf \f[C] --- patat: images: backend: auto \&... # A slide with only an image. ![](matterhorn.jpg) \f[R] .fi .PP \f[V]patat\f[R] can display full-size images on slides. For this to work \f[V]images\f[R] must be enabled in the configuration and the slide needs to contain only a single image and no other content. The image will be centered and resized to fit the terminal window. .PP \f[V]images\f[R] is off by default in the configuration. .PP \f[V]patat\f[R] supports the following image drawing backends: .IP \[bu] 2 \f[V]backend: iterm2\f[R]: uses iTerm2 (https://iterm2.com/)\[cq]s special escape sequence to render the image. This even works with animated GIFs! .IP \[bu] 2 \f[V]backend: kitty\f[R]: uses Kitty\[cq]s icat command (https://sw.kovidgoyal.net/kitty/kittens/icat.html). .IP \[bu] 2 \f[V]backend: w3m\f[R]: uses the \f[V]w3mimgdisplay\f[R] executable to draw directly onto the window. This has been tested in \f[V]urxvt\f[R] and \f[V]xterm\f[R], but is known to produce weird results in \f[V]tmux\f[R]. .RS 2 .PP If \f[V]w3mimgdisplay\f[R] is in a non-standard location, you can specify that using \f[V]path\f[R]: .IP .nf \f[C] backend: \[aq]w3m\[aq] path: \[aq]/home/jasper/.local/bin/w3mimgdisplay\[aq] \f[R] .fi .RE .SS Images using Evaluation .PP Rather than using the built-in image support, you can also use programs that write ASCII escape codes directly to the screen with code evaluation. .PP In order to do that, for example, we could configure \f[V]kitten\f[R] code snippets to evaluate using Kitty (https://sw.kovidgoyal.net/kitty/)\[cq]s command \f[V]icat\f[R]. This uses the \f[V]rawInline\f[R] code setting to ensure that the resulting output is not wrapped in a code block, and the \f[V]fragment\f[R] and \f[V]replace\f[R] settings immediately replace the snippet. .IP .nf \f[C] --- patat: eval: kitten: command: sed \[aq]s/\[ha]/kitten /\[aq] | bash replace: true fragment: false wrap: rawInline \&... See, for example: \[ga]\[ga]\[ga]kitten icat --align left dank-meme.jpg \[ga]\[ga]\[ga] \f[R] .fi .SS Breadcrumbs .PP By default, \f[V]patat\f[R] will print a breadcrumbs-style header, e.g.: .IP .nf \f[C] example.md > This is a title > This is a subtitle \f[R] .fi .PP This feature can be turned off by using: .IP .nf \f[C] patat: breadcrumbs: false \f[R] .fi .SS Slide numbers .PP By default, \f[V]patat\f[R] will display slide number in bottom-right corner .PP This feature can be turned off by using: .IP .nf \f[C] patat: slideNumber: false \f[R] .fi .SS Evaluating code .PP \f[V]patat\f[R] can evaluate code blocks and show the result. You can register an \f[I]evaluator\f[R] by specifying this in the YAML metadata: .IP .nf \f[C] --- patat: eval: ruby: command: irb --noecho --noverbose fragment: true # Optional replace: false # Optional wrap: code # Optional \&... Here is an example of a code block that is evaluated: \[ga]\[ga]\[ga]ruby puts \[dq]Hi\[dq] \[ga]\[ga]\[ga] \f[R] .fi .PP An arbitrary amount of evaluators can be specified, and whenever a a class attribute on a code block matches the evaluator, it will be used. .PP \f[B]Note that executing arbitrary code is always dangerous\f[R], so double check the code of presentations downloaded from the internet before running them if they contain \f[V]eval\f[R] settings. .PP Aside from the command, there are two more options: .IP \[bu] 2 \f[V]fragment\f[R]: Introduce a pause (see fragments) in between showing the original code block and the output. Defaults to \f[V]true\f[R]. .IP \[bu] 2 \f[V]replace\f[R]: Remove the original code block and replace it with the output rather than appending the output in a new code block. Defaults to \f[V]false\f[R]. .IP \[bu] 2 \f[V]wrap\f[R]: By default, the output is wrapped in a code block again with the original syntax highlighting. You can customize this behaviour by setting \f[V]wrap\f[R] to: .RS 2 .IP \[bu] 2 \f[V]code\f[R]: the default setting. .IP \[bu] 2 \f[V]raw\f[R]: no formatting applied. .IP \[bu] 2 \f[V]rawInline\f[R]: no formatting applied and no trailing newline. .RE .PP Setting \f[V]fragment: false\f[R] and \f[V]replace: true\f[R] offers a way to \[lq]filter\[rq] code blocks, which can be used to render ASCII graphics. .IP .nf \f[C] --- patat: eval: figlet: command: figlet fragment: false replace: true \&... \[ga]\[ga]\[ga]figlet Fancy Font \[ga]\[ga]\[ga] \f[R] .fi .PP This feature works by simply by: .IP "1." 3 Spawn a process with the provided command .IP "2." 3 Write the contents of the code block to the \f[V]stdin\f[R] of the process .IP "3." 3 Wait for the process to exit .IP "4." 3 Render the \f[V]stdout\f[R] of the process .SS Speaker Notes .PP \f[V]patat\f[R] supports comments which can be used as speaker notes. .IP .nf \f[C] --- title: This is my presentation author: Jane Doe \&... # Chapter 1 Slide contents. Yay. \f[R] .fi .PP You can also configure \f[V]patat\f[R] to write the speaker notes for the current slide to a file whenever the slide changes: .IP .nf \f[C] patat: speakerNotes: file: /tmp/notes.txt \f[R] .fi .PP Then, you can display these in a second terminal (presumably on a second monitor) by just displaying this file whenever it changes. entr (http://eradman.com/entrproject/) is one way to do that: .IP .nf \f[C] echo /tmp/notes.txt | entr -s \[aq]clear; cat /tmp/notes.txt\[aq] \f[R] .fi .PP Alternatively, just use a second \f[V]patat\f[R] instance with \f[V]--watch\f[R] enabled: .IP .nf \f[C] patat -w /tmp/notes.txt \f[R] .fi .PP Note that speaker notes should not start with \f[V] Slide two content. \f[R] .fi .PP Supported transitions \f[V]type\f[R]s: .IP \[bu] 2 \f[V]slideLeft\f[R]: slides the new slide in from right to left. .IP \[bu] 2 \f[V]dissolve\f[R]: changes characters over time. .PP All transitions currently take these arguments: .IP \[bu] 2 \f[V]frameRate\f[R]: number of frames per second. Defaults to 24. .IP \[bu] 2 \f[V]duration\f[R]: duration of the animation in seconds. Defaults to 1. .SS Random transitions .PP You can set \f[V]type\f[R] to \f[V]random\f[R] to randomly pick a transition effect. .IP .nf \f[C] patat: transition: type: random items: - type: dissolve duration: 3 - type: slideLeft frameRate: 10 \f[R] .fi .PP You can optionally set \f[V]items\f[R] to a non-empty list of transition effects to randomly sample from. If \f[V]items\f[R] is not set, \f[V]patat\f[R] will simply sample from all transition effects using their respective default settings. .SH OPTIONS .TP \f[V]-w\f[R], \f[V]--watch\f[R] If you provide the \f[V]--watch\f[R] flag, \f[V]patat\f[R] will watch the presentation file for changes and reload automatically. This is very useful when you are writing the presentation. .TP \f[V]-f\f[R], \f[V]--force\f[R] Run the presentation even if the terminal claims it does not support ANSI features. .TP \f[V]-d\f[R], \f[V]--dump\f[R] Just dump all the slides to stdout. This is useful for debugging. .TP \f[V]--version\f[R] Display version information. .SH SEE ALSO .PP pandoc(1) .SH AUTHORS Jasper Van der Jeugt.