magical markdown slides

chore: rename to lantern

+41 -41
Cargo.lock
··· 450 450 checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 451 451 452 452 [[package]] 453 + name = "lantern-cli" 454 + version = "0.1.0" 455 + dependencies = [ 456 + "clap", 457 + "crossterm 0.29.0", 458 + "lantern-core", 459 + "lantern-ui", 460 + "owo-colors", 461 + "ratatui", 462 + "tracing", 463 + "tracing-subscriber", 464 + ] 465 + 466 + [[package]] 467 + name = "lantern-core" 468 + version = "0.1.0" 469 + dependencies = [ 470 + "crossterm 0.29.0", 471 + "owo-colors", 472 + "pulldown-cmark", 473 + "serde", 474 + "serde_json", 475 + "serde_yml", 476 + "syntect", 477 + "terminal-colorsaurus", 478 + "thiserror", 479 + "toml", 480 + "tracing", 481 + ] 482 + 483 + [[package]] 484 + name = "lantern-ui" 485 + version = "0.1.0" 486 + dependencies = [ 487 + "crossterm 0.29.0", 488 + "lantern-core", 489 + "owo-colors", 490 + "ratatui", 491 + ] 492 + 493 + [[package]] 453 494 name = "lazy_static" 454 495 version = "1.5.0" 455 496 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 914 955 version = "0.3.7" 915 956 source = "registry+https://github.com/rust-lang/crates.io-index" 916 957 checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" 917 - 918 - [[package]] 919 - name = "slides-cli" 920 - version = "0.1.0" 921 - dependencies = [ 922 - "clap", 923 - "crossterm 0.29.0", 924 - "owo-colors", 925 - "ratatui", 926 - "slides-core", 927 - "slides-tui", 928 - "tracing", 929 - "tracing-subscriber", 930 - ] 931 - 932 - [[package]] 933 - name = "slides-core" 934 - version = "0.1.0" 935 - dependencies = [ 936 - "crossterm 0.29.0", 937 - "owo-colors", 938 - "pulldown-cmark", 939 - "serde", 940 - "serde_json", 941 - "serde_yml", 942 - "syntect", 943 - "terminal-colorsaurus", 944 - "thiserror", 945 - "toml", 946 - "tracing", 947 - ] 948 - 949 - [[package]] 950 - name = "slides-tui" 951 - version = "0.1.0" 952 - dependencies = [ 953 - "crossterm 0.29.0", 954 - "owo-colors", 955 - "ratatui", 956 - "slides-core", 957 - ] 958 958 959 959 [[package]] 960 960 name = "smallvec"
+35
Cargo.toml
··· 1 1 [workspace] 2 2 resolver = "2" 3 3 members = ["cli", "core", "ui"] 4 + 5 + [workspace.lints.clippy] 6 + bool_comparison = "deny" 7 + duplicate_mod = "deny" 8 + inconsistent_struct_constructor = "deny" 9 + invalid_regex = "deny" 10 + mem_forget = "deny" 11 + mixed_case_hex_literals = "deny" 12 + suspicious_arithmetic_impl = "deny" 13 + uninit_assumed_init = "deny" 14 + suspicious_else_formatting = "deny" 15 + suspicious_op_assign_impl = "deny" 16 + suspicious_to_owned = "deny" 17 + cmp_owned = "deny" 18 + cmp_null = "deny" 19 + manual_map = "deny" 20 + 21 + too_many_arguments = "warn" 22 + cyclomatic_complexity = "warn" 23 + large_enum_variant = "warn" 24 + needless_borrow = "warn" 25 + needless_pass_by_value = "warn" 26 + redundant_clone = "warn" 27 + unnecessary_cast = "warn" 28 + inefficient_to_string = "warn" 29 + or_fun_call = "warn" 30 + unnecessary_to_owned = "warn" 31 + map_clone = "warn" 32 + flat_map_identity = "warn" 33 + needless_collect = "warn" 34 + vec_init_then_push = "warn" 35 + 36 + len_zero = "allow" 37 + range_plus_one = "allow" 38 + manual_range_contains = "allow"
+73 -3
README.md
··· 1 - # slides.rs 1 + # lantern 2 2 3 3 > A modern, fast, terminal presentation tool inspired by [`maaslalani/slides`](https://github.com/maaslalani/slides), built with Rust. 4 4 5 + ## Quickstart 6 + 7 + ### Installation 8 + 9 + ```bash 10 + cargo install lantern 11 + ``` 12 + 13 + ### Create Your First Deck 14 + 15 + Create a markdown file `presentation.md`: 16 + 17 + ````markdown 18 + --- 19 + theme: nord 20 + --- 21 + 22 + # Welcome to lantern 23 + 24 + A terminal presentation tool built with Rust 25 + 26 + --- 27 + 28 + ## Features 29 + 30 + - Base16 theming system 31 + - Syntax highlighting 32 + - Live reload 33 + - Export to image/video 34 + 35 + --- 36 + 37 + ## Code Example 38 + 39 + ```rust 40 + fn main() { 41 + println!("Hello, lantern!"); 42 + } 43 + ``` 44 + 45 + --- 46 + 47 + ## That's it 48 + 49 + Press `q` to quit, `←/→` to navigate 50 + 51 + ```` 52 + 53 + ### Present 54 + 55 + ```bash 56 + # Interactive TUI mode 57 + lantern present presentation.md 58 + 59 + # Print to stdout 60 + lantern print presentation.md 61 + 62 + # With custom theme 63 + lantern present presentation.md --theme catppuccin-mocha 64 + ``` 65 + 66 + ### Navigation 67 + 68 + | Key | Action | 69 + | ------------ | ------------------- | 70 + | `→`, `j`, `n` | Next slide | 71 + | `←`, `k`, `p` | Previous slide | 72 + | `1-9` | Jump to slide | 73 + | `q` | Quit | 74 + 5 75 ## Design Principles 6 76 7 77 __Color as Data:__ 8 78 All color use flows through typed wrappers using `owo-colors`. No ad-hoc ANSI escapes. 9 79 10 80 __Themeable:__ 11 - Multiple built-in color schemes (basic, monokai, dracula, solarized, nord) with automatic light/dark variant detection based on terminal background. Themes can be selected via frontmatter, CLI flags, or environment variables, with optional explicit variant override using `:light` or `:dark` suffix. 81 + Built on the [Base16](https://github.com/chriskempson/base16) theming system with 10 prebuilt themes (Catppuccin, Nord, Gruvbox Material, Solarized, Oxocarbon). Each theme defines 16 semantic colors mapped to content and UI elements. Themes can be selected via frontmatter, CLI flags, or environment variables. 12 82 13 83 __Reproducible:__ 14 - Everything is reproducible in plain text — decks can render without TUI (using `slides print`). 84 + Everything is reproducible in plain text — decks can render without TUI (using `lantern print`). 15 85 16 86 __Composable:__ 17 87 Parser → Model → Renderer are independent modules with tests and traits.
+3 -3
cli/Cargo.toml
··· 1 1 [package] 2 - name = "slides-cli" 2 + name = "lantern-cli" 3 3 version = "0.1.0" 4 4 edition = "2024" 5 5 ··· 10 10 ratatui = "0.29.0" 11 11 tracing = "0.1.41" 12 12 tracing-subscriber = "0.3.20" 13 - slides-core = { path = "../core" } 14 - slides-tui = { path = "../ui" } 13 + lantern-core = { path = "../core" } 14 + lantern-ui = { path = "../ui" }
+3 -3
cli/src/main.rs
··· 1 1 use clap::{Parser, Subcommand}; 2 + use lantern_core::{parser::parse_slides_with_meta, term::Terminal as SlideTerminal, theme::ThemeRegistry}; 3 + use lantern_ui::App; 2 4 use ratatui::{Terminal, backend::CrosstermBackend}; 3 - use slides_core::{parser::parse_slides_with_meta, term::Terminal as SlideTerminal, theme::ThemeRegistry}; 4 - use slides_tui::App; 5 5 use std::{io, path::PathBuf}; 6 6 use tracing::Level; 7 7 ··· 158 158 159 159 let theme = ThemeRegistry::get(&theme_name); 160 160 161 - slides_core::printer::print_slides_to_stdout(&slides, &theme, width)?; 161 + lantern_core::printer::print_slides_to_stdout(&slides, &theme, width)?; 162 162 163 163 Ok(()) 164 164 }
+1 -1
core/Cargo.toml
··· 1 1 [package] 2 - name = "slides-core" 2 + name = "lantern-core" 3 3 version = "0.1.0" 4 4 edition = "2024" 5 5
+9 -9
docs/src/appendices/themes.md
··· 1 1 # Themes 2 2 3 - slides.rs uses the [Base16](https://github.com/chriskempson/base16) theming system for customizing the appearance of your presentations. Base16 provides a standardized way to define color schemes that work consistently across dark and light backgrounds. 3 + lantern uses the [Base16](https://github.com/chriskempson/base16) theming system for customizing the appearance of your presentations. Base16 provides a standardized way to define color schemes that work consistently across dark and light backgrounds. 4 4 5 5 ## Base16 Color System 6 6 ··· 27 27 28 28 ## Color Mapping 29 29 30 - slides.rs maps base16 colors to semantic roles: 30 + lantern maps base16 colors to semantic roles: 31 31 32 32 ### Content Colors 33 33 ··· 51 51 52 52 ## Available Themes 53 53 54 - slides.rs includes 10 prebuilt base16 themes, embedded at compile time: 54 + lantern includes 10 prebuilt base16 themes, embedded at compile time: 55 55 56 56 ### Catppuccin 57 57 ··· 109 109 Override the theme with the `--theme` flag: 110 110 111 111 ```bash 112 - slides present slides.md --theme nord 113 - slides print slides.md --theme catppuccin-latte 112 + lantern present presentation.md --theme nord 113 + lantern print presentation.md --theme catppuccin-latte 114 114 ``` 115 115 116 116 ### Via Environment Variable 117 117 118 - Set a default theme using the `SLIDES_THEME` environment variable: 118 + Set a default theme using the `LANTERN_THEME` environment variable: 119 119 120 120 ```bash 121 - export SLIDES_THEME=gruvbox-material-dark 122 - slides present slides.md 121 + export LANTERN_THEME=gruvbox-material-dark 122 + lantern present presentation.md 123 123 ``` 124 124 125 125 ## Theme Priority ··· 128 128 129 129 1. Command line flag (`--theme`) 130 130 2. Frontmatter metadata (`theme:` field) 131 - 3. Environment variable (`SLIDES_THEME`) 131 + 3. Environment variable (`LANTERN_THEME`) 132 132 4. Default theme (nord for dark terminals, nord-light for light terminals) 133 133 134 134 ## Custom Themes (Coming Soon)
+11 -11
docs/src/quickstart.md
··· 1 1 # Quickstart 2 2 3 - Get started with slides-rs in minutes. 3 + Get started with lantern in minutes. 4 4 5 5 ## Installation 6 6 7 7 Currently, you'll need to build from source: 8 8 9 9 ```bash 10 - git clone https://github.com/yourusername/slides-rs.git 11 - cd slides-rs 10 + git clone https://github.com/yourusername/lantern.git 11 + cd lantern 12 12 cargo build --release 13 13 ``` 14 14 15 - The binary will be available at `target/release/slides`. 15 + The binary will be available at `target/release/lantern`. 16 16 17 17 ## Creating Your First Deck 18 18 ··· 46 46 47 47 ```rust 48 48 fn main() { 49 - println!("Hello, slides!"); 49 + println!("Hello, lantern!"); 50 50 } 51 51 ``` 52 52 ··· 73 73 Run the interactive TUI presenter: 74 74 75 75 ```bash 76 - slides present presentation.md 76 + lantern present presentation.md 77 77 ``` 78 78 79 79 ### Navigation Keys ··· 89 89 Print all slides to stdout with formatting: 90 90 91 91 ```bash 92 - slides print presentation.md 92 + lantern print presentation.md 93 93 ``` 94 94 95 95 Adjust output width: 96 96 97 97 ```bash 98 - slides print presentation.md --width 100 98 + lantern print presentation.md --width 100 99 99 ``` 100 100 101 101 Use a specific theme: 102 102 103 103 ```bash 104 - slides print presentation.md --theme dark 104 + lantern print presentation.md --theme nord 105 105 ``` 106 106 107 107 ## Slide Separators ··· 186 186 Customize defaults with environment variables: 187 187 188 188 ```bash 189 - # Set default theme (options: default, dark, light, monokai, dracula, solarized_dark, nord) 190 - export SLIDES_THEME=dark 189 + # Set default theme 190 + export LANTERN_THEME=nord 191 191 192 192 # Set default author (used if not in frontmatter) 193 193 export USER=YourName
+2 -2
ui/Cargo.toml
··· 1 1 [package] 2 - name = "slides-tui" 2 + name = "lantern-ui" 3 3 version = "0.1.0" 4 4 edition = "2024" 5 5 6 6 [dependencies] 7 7 ratatui = "0.29.0" 8 8 crossterm = "0.29.0" 9 - slides-core = { path = "../core" } 9 + lantern-core = { path = "../core" } 10 10 owo-colors = "4.2.3"
+2 -2
ui/src/app.rs
··· 1 + use lantern_core::{metadata::Meta, slide::Slide, term::InputEvent, theme::ThemeColors}; 1 2 use ratatui::{Terminal as RatatuiTerminal, backend::Backend}; 2 - use slides_core::{metadata::Meta, slide::Slide, term::InputEvent, theme::ThemeColors}; 3 3 use std::io; 4 4 use std::time::{Duration, Instant}; 5 5 ··· 91 91 #[cfg(test)] 92 92 mod tests { 93 93 use super::*; 94 - use slides_core::slide::{Block, TextSpan}; 94 + use lantern_core::slide::{Block, TextSpan}; 95 95 96 96 fn create_test_app() -> App { 97 97 let slides = vec![
+1 -1
ui/src/lib.rs
··· 8 8 pub use renderer::render_slide_content; 9 9 pub use viewer::SlideViewer; 10 10 11 - pub use slides_core::{ 11 + pub use lantern_core::{ 12 12 slide::{Block, Slide, TextSpan}, 13 13 theme::ThemeColors, 14 14 };
+6 -6
ui/src/renderer.rs
··· 2 2 style::{Modifier, Style}, 3 3 text::{Line, Span, Text}, 4 4 }; 5 - use slides_core::{ 5 + use lantern_core::{ 6 6 highlighter, 7 7 slide::{Block, CodeBlock, List, Table, TextSpan, TextStyle}, 8 8 theme::ThemeColors, ··· 202 202 } 203 203 204 204 /// Convert theme Color to ratatui Style with RGB colors 205 - fn to_ratatui_style(color: &slides_core::theme::Color, bold: bool) -> Style { 205 + fn to_ratatui_style(color: &lantern_core::theme::Color, bold: bool) -> Style { 206 206 let mut style = Style::default().fg(ratatui::style::Color::Rgb(color.r, color.g, color.b)); 207 207 208 208 if bold { ··· 214 214 215 215 #[cfg(test)] 216 216 mod tests { 217 - use slides_core::slide::ListItem; 217 + use lantern_core::slide::ListItem; 218 218 219 219 use super::*; 220 220 ··· 275 275 276 276 #[test] 277 277 fn to_ratatui_style_converts_color() { 278 - use slides_core::theme::Color; 278 + use lantern_core::theme::Color; 279 279 280 280 let color = Color::new(255, 128, 64); 281 281 let style = to_ratatui_style(&color, false); ··· 285 285 286 286 #[test] 287 287 fn to_ratatui_style_applies_bold() { 288 - use slides_core::theme::Color; 288 + use lantern_core::theme::Color; 289 289 290 290 let color = Color::new(100, 150, 200); 291 291 let style = to_ratatui_style(&color, true); ··· 296 296 297 297 #[test] 298 298 fn to_ratatui_style_no_bold_when_false() { 299 - use slides_core::theme::Color; 299 + use lantern_core::theme::Color; 300 300 301 301 let color = Color::new(100, 150, 200); 302 302 let style = to_ratatui_style(&color, false);
+2 -2
ui/src/viewer.rs
··· 5 5 text::{Line, Span}, 6 6 widgets::{Block, Borders, Paragraph, Wrap}, 7 7 }; 8 - use slides_core::{slide::Slide, theme::ThemeColors}; 8 + use lantern_core::{slide::Slide, theme::ThemeColors}; 9 9 use std::time::Instant; 10 10 11 11 use crate::renderer::render_slide_content; ··· 173 173 #[cfg(test)] 174 174 mod tests { 175 175 use super::*; 176 - use slides_core::slide::{Block, TextSpan}; 176 + use lantern_core::slide::{Block, TextSpan}; 177 177 178 178 fn create_test_slides() -> Vec<Slide> { 179 179 vec![