Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
## Features

![Demo](./assets/demo.gif)
*(Want to create a demo like this? Check out the [recording documentation](demo/recording-demo.md))*

- **Standalone Executable** - perfect for wrapping slow commands in bash scripts
- **16 built-in spinner styles** - dots, line, arc, bounce, and more
Expand Down
Binary file modified assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 0 additions & 98 deletions demo.lua

This file was deleted.

3 changes: 2 additions & 1 deletion demo/demo.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env -S lx lua
--- Demo script for Roda terminal spinner library
--- Run this script to see all features in action
--- Run this script using: just demo run
--- Record this script using: just demo record

local system = require("system")

Expand Down
10 changes: 5 additions & 5 deletions demo.tape → demo/demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
# lx install (or ensure roda is in package.path)
#
# Generate GIF:
# vhs demo.tape
# just demo record
#
# Generate MP4:
# vhs demo.tape --output assets/demo.mp4
# vhs demo.tape --output ../assets/demo.mp4

# Output configuration
Output assets/demo.gif
Set Shell "zsh"
Output ../assets/demo.gif
Set Shell "bash"

# Set up a 1200x600 terminal
Set FontSize 30
Expand All @@ -27,7 +27,7 @@ Set PlaybackSpeed 1
Sleep 500ms

# Show command being typed
Type "lua demo.lua"
Type "just demo run"
Sleep 300ms
Enter

Expand Down
8 changes: 8 additions & 0 deletions demo/mod.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[doc("Run the demo script to showcase Roda features")]
run:
lx lua -- demo/demo.lua

[doc("Record the demo and generate a GIF using VHS")]
record:
cd demo && vhs demo.tape

51 changes: 51 additions & 0 deletions demo/recording-demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Recording the Demo GIF

Generate the demo GIF using [VHS](https://github.com/charmbracelet/vhs).

## Prerequisites

```bash
brew install vhs # Terminal recorder
lx install # Or ensure roda is in package.path
```

## Demo Script

`demo/demo.lua` showcases Roda features:
- Basic spinner usage
- Terminal states (succeed, fail, warn, info)
- Dynamic text updates
- Different spinner styles

Run interactively: `just demo run`

## Recording

Generate the GIF:
```bash
just demo record
```

This runs `vhs` with `demo/demo.tape`, producing `assets/demo.gif`.

## Tape Configuration

`demo/demo.tape` configures the recording:
```tape
Output ../assets/demo.gif
Set Shell "bash"
Set FontSize 30
Set Width 1200
Set Height 600
Set TypingSpeed 50ms
Set PlaybackSpeed 1
```

Customize settings like `FontSize`, `Width`, `Height` as needed.

## Tips

- Use a dark terminal background for contrast
- Ensure terminal uses a monospace font (JetBrains Mono, Fira Code)
- The demo runs ~18 seconds; adjust `Sleep` in the tape accordingly
- For MP4 output: `vhs demo.tape --output ../assets/demo.mp4`
96 changes: 0 additions & 96 deletions docs/recording-demo.md

This file was deleted.

2 changes: 2 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ set unstable := true

# Enable latest Just features

mod demo

set dotenv-load := true

# Auto-load .env files
Expand Down
Loading