magical markdown slides
Slides#
Plumbing#
Objective: Establish a clean, testable core with clap and a minimal ratatui loop.
| Task | Description | Key Crates |
|---|---|---|
| ✓ Project Scaffolding | Initialize workspace with slides-core, slides-cli, and slides-ui crates. |
cargo, just, clap |
Use cargo-generate and a justfile for scripts. |
||
| ✓ CLI Definition | Implement root command slides with subcommands: |
clap1 |
• present (TUI) |
||
• print (stdout) |
||
• init (scaffold deck) |
||
• check (lint slides). |
||
| ✓ Logging & Colors | Integrate structured logs via tracing. |
owo-colors2, tracing |
| Use owo-colors for color abstraction (no dynamic dispatch). | ||
| ✓ Terminal & Event Setup | Configure alternate screen, raw mode, input loop, resize handler. | crossterm3, ratatui |
| CI/CD + Tooling | Setup cargo fmt, clippy, test, and cross matrix CI. |
GitHub Actions |
Data Model (Parser & Slides)#
Objective: Parse markdown documents into a rich Slide struct.
| Task | Description | Key Crates |
|---|---|---|
| ✓ Parser Core | Split files on --- separators. |
pulldown-cmark4 |
| Detect title blocks, lists, and code fences. | ||
Represent as Vec<Slide>. |
||
| ✓ Slide Model | Define structs: Slide, Block, TextSpan, CodeBlock, etc. |
Internal |
| ✓ Metadata Parsing | Optional front matter (YAML/TOML) for theme, author, etc. | serde_yml5 |
| Error & Validation | Provide friendly parser errors with file/line info. | thiserror6 |
| ✓ Basic CLI UX | slides present file.md runs full TUI. |
clap |
slides print renders to stdout with width constraint. |
Rendering & Navigation#
Objective: Build the interactive slide renderer with navigation.
| Task | Description | Key Crates |
|---|---|---|
| ✓ Ratatui Integration | Build basic slide viewer using layout, blocks, paragraphs. | ratatui7 |
| ✓ Input & State | Support ←/→, j/k, q, numeric jumps, and window resize. |
crossterm, ratatui |
| ✓ Status Bar | Display slide count, filename, clock, and theme name. | ratatui |
| ✓ Color Styling | Apply consistent color palette via owo-colors. Define traits like ThemeColor. |
owo-colors |
| Configurable Themes | Support themes via TOML files mapping semantic roles (heading, body, accent) → color pairs. |
toml, serde |
Code Highlighting via Syntect#
Objective: Add first-class syntax highlighting using Syntect.
| Task | Description | Key Crates |
|---|---|---|
| Syntect | Load .tmTheme / .sublime-syntax definitions on startup. |
syntect8 |
Cache SyntaxSet + ThemeSet. |
||
| Code Blocks | Detect fenced code blocks with language tags. | syntect, owo-colors |
Render syntax-highlighted text with color spans mapped to owo-colors. |
||
| Theming | Map terminal theme choice to Syntect theme (e.g., "OneDark", "Monokai"). |
syntect |
| Performance | Lazy-load themes and syntaxes; use once_cell for caching. |
once_cell |
| Mode | Render to ANSI-colored plain text output (for slides print). |
owo-colors |
Presenter#
Objective: Introduce features for live presentations and authoring convenience.
| Task | Description | Key Crates |
|---|---|---|
| Speaker Notes | n toggles speaker notes (parsed via ::: notes). |
ratatui |
| Timer & Progress | Session timer + per-slide progress bar. | ratatui, chrono |
| Live Reload | File watcher auto-refreshes content. | notify9 |
| Search | Fuzzy find slide titles via ctrl+f. |
fuzzy-matcher10 |
| Theme Commands | CLI flag --theme <name> switches both Syntect + owo themes. |
clap, internal ThemeRegistry |
Markdown Extension#
Objective: Add richness and visual polish to text and layout.
| Task | Description | Key Crates |
|---|---|---|
| Tables & Lists | Render GitHub-style tables, bullets, and task lists. | pulldown-cmark, ratatui |
| Admonitions | Highlighted boxes with icons | owo-colors, internal glyphs |
| Horizontal Rules | Use box-drawing (─, ═) and shading (░, ▓). |
Unicode constants |
| Generators | slides init scaffolds an example deck with code and notes. |
include_str!, fs |
RC#
| Task | Description | Key Crates |
|---|---|---|
| Config Discovery | Read from $XDG_CONFIG_HOME/slides/config.toml for defaults. |
dirs, serde |
| Theme Registry | Built-in theme manifest (e.g., onedark, solarized, plain). |
Internal |
| Release | Tag v1.0.0-rc.1 with changelog and binaries for major platforms. |
cargo-dist, GitHub Actions |