2023-12-08 16:13:57 -08:00
2023-12-08 12:30:48 -07:00
2023-11-09 06:54:08 -08:00
2023-12-08 12:30:48 -07:00
2023-08-27 14:14:02 -07:00
2023-11-26 14:05:44 -08:00
2023-11-24 08:27:03 -08:00
2023-10-19 10:41:37 -07:00
2023-10-08 07:25:02 -07:00
2023-08-27 14:14:02 -07:00

presenterm

A terminal based slideshow tool.


presenterm lets you define slideshows that run in your terminal.

This is how the demo presentation looks like:

Installation

There's different ways to install presenterm.

The recommended way to install presenterm is to download the latest pre-built version for your system from the releases page.

Install via cargo

Alternatively, download rust and run:

cargo install presenterm

Latest unreleased version

To run the latest unreleased version clone the repo, then run:

cargo build --release

The output binary will be in ./target/release/presenterm.

Arch user repository

presenterm is in the AUR as well. If you have any AUR helpers like paru/yay, you can install it as follows:

paru/yay -S presenterm-bin # for binary
paru/yay -S presenterm-git # for building from source

Nix

To install presenterm using the Nix package manager run:

nix-env -iA nixos.presenterm    # for nixos
nix-env -iA nixpkgs.presenterm  # for non-nixos

Or, you can install it by adding the following to your configuration.nix if you are on NixOS

environment.systemPackages = [
  pkgs.presenterm
];

Alternatively if you're a Nix user using flakes you can run:

nix run nixpkgs#presenterm            # to run from nixpkgs
nix run github:mfontanini/presenterm  # to run from github repo

For more information see nixpkgs

Features

  • Define your presentation in a single markdown file.
  • Image rendering support for iterm2, terminals that support the kitty graphics protocol, or sixel.
  • Customize your presentation's look by defining themes, including colors, margins, layout (left/center aligned content), footer for every slide, etc.
  • Code highlighting for a wide list of programming languages.
  • Selective/dynamic code highlighting such that only a subset of the lines are highlighted at a time, and different sets of lines are highlighted as you move your slides forward.
  • Configurable column layouts that let you structure parts of your slide into columns.
  • Support for an introduction slide that displays the presentation title and your name.
  • Support for slide titles.
  • Support for shell code execution.
  • Support for generating a PDF version of your presentation to share with other people.
  • Create pauses in between each slide so that it progressively renders for a more interactive presentation.
  • Text formatting support for bold, italics, strikethrough, and inline code.
  • Automatically reload your presentation every time it changes for a fast development loop.

Hot reload

Unless you run in presentation mode by passing in the --present parameter, presenterm will automatically reload your presentation file every time you save it. presenterm will also automatically detect which specific slide was modified and jump to it so you don't have to be jumping back and forth between the source markdown and the presentation to see how the changes look like.

asciicast

Slides

Every slide must be separated by an HTML comment:

<!-- end_slide -->

This makes it explicit that you want to end the current slide. Other tools use --- instead which is less explicit and also is a valid markdown element which you may use in your presentation.

Pauses

Just like lookatme does, presenterm allows pauses in between your slide. This lets you have more interactive presentations where pieces of it start popping up as you move forward through it.

Similar to slide delimiters, pauses can be created by using the following HTML comment:

<!-- pause -->

Images

Images are supported if you're using iterm2, a terminal the supports the kitty graphics protocol (such as kitty, of course), or one that supports sixel. sixel support requires building presenterm with the sixel feature flag, which is disabled by default. You can do this by passing in the --features sixel parameters when running cargo build:

cargo build --release --features sixel

Note

: this feature flag is only needed if your terminal emulator only supports sixel. Many terminals support the kitty or iterm2 protocols so this isn't necessary.

Images are rendered in their default size. This means if your terminal window is 100 pixels wide and your image is 50 pixels wide, it will take up 50% of the width. If an image does not fit in the screen, it will be scaled down to fit it.

Note

: image rendering is currently not supported on Windows.

Themes

presenterm supports themes so you can customize your presentation's look. See the built-in themes as examples on how to customize them.

You can define your own themes and make your presentation use it or you can also customize a theme within your presentation by including a front matter at the beginning of your presentation file:

---
theme:
  # Specify it by name for built-in themes
  name: my-favorite-theme

  # Otherwise specify the path for it
  path: /home/myself/themes/epic.yaml

  # Or override parts of the theme right here
  override:
    default:
      colors:
        foreground: "beeeff"
---

Note that if you're in the default hot reload mode, overriding your theme will result in those changes being immediately applied to your presentation. This lets you easily test out color schemes quickly without having to close and reopen the application.

See the documentation on themes to learn more.

Introduction slide

By including a title, sub_title and/or author attribute in your front matter, you can create an introduction slide at the beginning of your presentation to display those:

---
title: My first presentation
sub_title: (in presenterm!)
author: John Doe
---

Slide titles

By using setext headers you can create slide titles. These allow you to have a more slide-title-looking slide titles than using regular markdown headers:

My slide title
---

Note: nothing prevents you from using setext headers somewhere in the middle of a slide, which will make them render as slide titles. Not sure why you'd want that but hey, you're free to do so!

Column layouts

Column layouts allow you to organize content into columns. You can define 2 or more columns, choose how wide you want them to be, and then put any content into them. For example:

See the documentation on layouts to learn more.

Shell code execution

Any shell code can be marked for execution, making presenterm execute it and render its output when you press ctrl+e. In order to do this, annotate the code block with +exec (e.g. bash +exec). Obviously use this at your own risk!

asciicast

See more details on this here.

PDF export

Presentations can be converted into PDF by using a helper tool. You can install it by running:

pip install presenterm-export

The only external dependency you'll need is tmux. After you've installed both of these, simply run presenterm with the --export-pdf parameter to generate the output PDF:

presenterm --export-pdf examples/demo.md

The output PDF will be placed in examples/demo.pdf. The size of each page will depend on the size of your terminal so make sure to adjust accordingly before running the command above.

Note: if you're using a separate virtual env to install presenterm-export just make sure you activate it before running presenterm with the --export-pdf parameter.

Navigation

Navigation should be intuitive: jumping to the next/previous slide can be done by using the arrow, hjkl, and page up/down keys.

Besides this:

  • Jumping to the first slide: gg.
  • Jumping to the last slide: G.
  • Jumping to a specific slide: <slide-number>G.
  • Exit the presentation: <ctrl>c.
  • Refresh images: <ctrl>r.

Docs

Some docs on how to configure presenterm and how it works internally can be found here.

Acknowledgements

This tool is heavily inspired:

Support for code highlighting on many languages is thanks to bat, which contains a custom set of syntaxes that extend syntect's default set of supported languages. Run presenterm --acknowledgements to get a full list of all the licenses for the binary files being pulled in.

Languages
Rust 99.2%
Shell 0.4%
Nix 0.2%
JavaScript 0.2%