Skip to main content

TermDeck

Terminal presentations, written in Markdown or Python. Built on Textual.

Each file in a deck folder is one slide. Navigate with the arrow keys.

Install

pip install termdeck

Optional extras:

pip install "termdeck[music]"   # interactive music-pad slides

Requires Python 3.10 or newer.

Usage

termdeck                # play the bundled sample deck
termdeck ./my-deck      # play your own deck
python -m termdeck      # same thing

Navigate with ← / → arrow keys.

While viewing a slide that contains an image:

  • f — toggle fullscreen image view
  • o — open the image in your system default image viewer
  • Esc — exit fullscreen
  • Ctrl+C — quit

Writing a deck

A deck is a folder of slide files. Files are sorted by name.

Markdown slides

# My title

- a bullet
- another bullet

![diagram](diagram.png)

Image paragraphs (![alt](path)) are rendered as images. Relative paths are resolved from the slide file's directory.

Images are rendered using the best available terminal graphics method: Kitty graphics protocol, Sixel, iTerm2 inline images, or a colored half-block fallback. This means images stay crisp even when you zoom the terminal font to make text readable.

Supported formats: png, jpg, jpeg, gif, webp, bmp.

Images are horizontally centered. By default ![alt](path) images render at a fixed width of 60 cells. To control an individual image's size, use a standard HTML <img> tag:

<img src="diagram.png" width="80%">
<img src="diagram.png" width="60" height="auto">

To change the default size or alignment for all images in a deck, add a deck.tcss file in your deck folder:

/* Default: 60 cells wide, centered */
#markdown-slide ImageWidget {
    width: 60;
    height: auto;
    margin: 0 10;
}

If image auto-detection misbehaves in your terminal, force a specific renderer:

TERMDECK_IMAGE_PROTOCOL=kitty termdeck ./my-deck     # Kitty TGP
TERMDECK_IMAGE_PROTOCOL=sixel termdeck ./my-deck     # Sixel
TERMDECK_IMAGE_PROTOCOL=halfcell termdeck ./my-deck  # colored half blocks
TERMDECK_IMAGE_PROTOCOL=unicode termdeck ./my-deck   # unicode characters

Python slides

A Python slide is a Textual Screen. It must expose a Slide class:

from textual.app import ComposeResult
from textual.screen import Screen
from textual.widgets import Button

class Slide(Screen):
    def compose(self) -> ComposeResult:
        yield Button("Hello")

The screen's widgets are styled by styles/default.tcss. You can add a deck.tcss file in your deck folder to override styles. All Textual functionality is available for rich, interactive slides.

Development

pip install -e ".[dev]"
python test.py
python -m build

License

MIT

Terminal graphics rendering is provided by textual-image (LGPL-3.0-or-later).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

termdeck-0.2.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

termdeck-0.2.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file termdeck-0.2.1.tar.gz.

File metadata

  • Download URL: termdeck-0.2.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.2

File hashes

Hashes for termdeck-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9483e4b20c0498a5751972778ed673004c34f2c4a93b4789f1696fa512dc096c
MD5 bc8438f92f3ccd1af17b62f50c665611
BLAKE2b-256 69620f1ec888971411ce4e2eecbf0ff72eecdacd4558933ae2ef00f56008f749

See more details on using hashes here.

File details

Details for the file termdeck-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: termdeck-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.2

File hashes

Hashes for termdeck-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 351f76c0f83ab1c5360b76cf8cf51c0bd6f6e175aa8b9998d8dc0955ca8b632f
MD5 05f57cb146f3ba6c24456cd8538326cb
BLAKE2b-256 037d10f5dfaa4b168543554c0869498844dcfbb79af5162b2ef110d1577c4cdf

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page