···11+# Quickstart
22+33+Get started with slides-rs in minutes.
44+55+## Installation
66+77+Currently, you'll need to build from source:
88+99+```bash
1010+git clone https://github.com/yourusername/slides-rs.git
1111+cd slides-rs
1212+cargo build --release
1313+```
1414+1515+The binary will be available at `target/release/slides`.
1616+1717+## Creating Your First Deck
1818+1919+Create a new markdown file called `presentation.md`:
2020+2121+````markdown
2222+---
2323+theme: default
2424+author: Your Name
2525+---
2626+2727+# Welcome to Slides
2828+2929+A modern terminal-based presentation tool
3030+3131+---
3232+3333+## Features
3434+3535+- Parse markdown into slides
3636+- Interactive TUI navigation with full keyboard support
3737+- Speaker notes with toggle visibility
3838+- Live presentation timer
3939+- Status bar with slide count and navigation hints
4040+- Print to stdout
4141+- Syntax highlighting (coming soon)
4242+4343+---
4444+4545+## Code Example
4646+4747+```rust
4848+fn main() {
4949+ println!("Hello, slides!");
5050+}
5151+```
5252+5353+Supports multiple languages with syntax highlighting.
5454+5555+---
5656+5757+## Lists and Formatting
5858+5959+- Unordered lists with bullets
6060+- **Bold text** for emphasis
6161+- *Italic text* for style
6262+- `inline code` for commands
6363+6464+---
6565+6666+# Thank You
6767+6868+Questions?
6969+````
7070+7171+## Presenting Your Slides
7272+7373+Run the interactive TUI presenter:
7474+7575+```bash
7676+slides present presentation.md
7777+```
7878+7979+### Navigation Keys
8080+8181+- `→`, `j`, `Space`, `n` - Next slide
8282+- `←`, `k`, `p` - Previous slide
8383+- `0-9` - Jump to slide (single digit)
8484+- `Shift+N` - Toggle speaker notes
8585+- `q`, `Ctrl+C`, `Esc` - Quit presentation
8686+8787+## Printing to Stdout
8888+8989+Print all slides to stdout with formatting:
9090+9191+```bash
9292+slides print presentation.md
9393+```
9494+9595+Adjust output width:
9696+9797+```bash
9898+slides print presentation.md --width 100
9999+```
100100+101101+Use a specific theme:
102102+103103+```bash
104104+slides print presentation.md --theme dark
105105+```
106106+107107+## Slide Separators
108108+109109+Slides are separated by three dashes on a line by themselves:
110110+111111+```markdown
112112+# Slide 1
113113+114114+Content here
115115+116116+---
117117+118118+# Slide 2
119119+120120+More content
121121+```
122122+123123+## Front Matter
124124+125125+Optional metadata at the start of your file:
126126+127127+YAML format:
128128+129129+```yaml
130130+---
131131+theme: dark
132132+author: Jane Doe
133133+---
134134+```
135135+136136+TOML format:
137137+138138+```toml
139139++++
140140+theme = "monokai"
141141+author = "John Smith"
142142++++
143143+```
144144+145145+## Supported Markdown
146146+147147+Currently supported:
148148+149149+- Headings (H1-H6)
150150+- Paragraphs with inline formatting (bold, italic, strikethrough, code)
151151+- Code blocks with language tags
152152+- Lists (ordered and unordered with nesting)
153153+- Horizontal rules
154154+- Blockquotes
155155+- Tables
156156+157157+## Speaker Notes
158158+159159+Add speaker notes to any slide using the `::: notes` directive:
160160+161161+```markdown
162162+# Your Slide Title
163163+164164+Main content visible to the audience.
165165+166166+::: notes
167167+These are your speaker notes.
168168+Press Shift+N to toggle their visibility.
169169+They appear in a separate panel during presentation.
170170+:::
171171+```
172172+173173+## Status Bar
174174+175175+The status bar at the bottom displays:
176176+177177+- Filename of the current presentation
178178+- Current slide number / Total slides
179179+- Active theme name
180180+- Navigation hints
181181+- Notes visibility indicator (✓ when shown)
182182+- Elapsed presentation time (HH:MM:SS)
183183+184184+## Environment Variables
185185+186186+Customize defaults with environment variables:
187187+188188+```bash
189189+# Set default theme
190190+export SLIDES_THEME=dark
191191+192192+# Set default author (used if not in frontmatter)
193193+export USER=YourName
194194+```
+436
examples/learn-rust.md
···11+---
22+theme: default
33+author: Learn Rust
44+---
55+66+# Learn Rust
77+88+A quick tour through Rust fundamentals
99+1010+---
1111+1212+## Comments
1313+1414+Rust supports multiple comment styles:
1515+1616+```rust
1717+// Line comments look like this
1818+// and extend multiple lines
1919+2020+/* Block comments
2121+ /* can be nested. */ */
2222+2323+/// Documentation comments support markdown
2424+/// # Examples
2525+/// ```
2626+/// let five = 5
2727+/// ```
2828+```
2929+3030+---
3131+3232+## Functions
3333+3434+Functions use `fn` keyword with type annotations:
3535+3636+```rust
3737+fn add2(x: i32, y: i32) -> i32 {
3838+ // Implicit return (no semicolon)
3939+ x + y
4040+}
4141+```
4242+4343+**Key points:**
4444+4545+- `i32` is a 32-bit signed integer
4646+- Last expression without `;` is the return value
4747+- Function parameters must have type annotations
4848+4949+---
5050+5151+## Variables
5252+5353+Rust has immutable bindings by default:
5454+5555+```rust
5656+// Immutable binding
5757+let x: i32 = 1;
5858+5959+// Type inference works most of the time
6060+let implicit_x = 1;
6161+let implicit_f = 1.3;
6262+6363+// Mutable variable
6464+let mut mutable = 1;
6565+mutable = 4;
6666+mutable += 2;
6767+```
6868+6969+---
7070+7171+## Numbers
7272+7373+Integer and float types with suffixes:
7474+7575+```rust
7676+// Integer/float suffixes
7777+let y: i32 = 13i32;
7878+let f: f64 = 1.3f64;
7979+8080+// Arithmetic
8181+let sum = x + y + 13;
8282+```
8383+8484+---
8585+8686+## Strings
8787+8888+Two main string types in Rust:
8989+9090+```rust
9191+// String slice (&str) - immutable view
9292+let x: &str = "hello world!";
9393+9494+// String - heap-allocated, growable
9595+let s: String = "hello world".to_string();
9696+9797+// String slice from String
9898+let s_slice: &str = &s;
9999+100100+// Printing
101101+println!("{} {}", f, x);
102102+```
103103+104104+---
105105+106106+## Arrays and Vectors
107107+108108+Fixed-size arrays and dynamic vectors:
109109+110110+```rust
111111+// Fixed-size array
112112+let four_ints: [i32; 4] = [1, 2, 3, 4];
113113+114114+// Dynamic vector
115115+let mut vector: Vec<i32> = vec![1, 2, 3, 4];
116116+vector.push(5);
117117+118118+// Slice - immutable view
119119+let slice: &[i32] = &vector;
120120+121121+// Debug printing
122122+println!("{:?} {:?}", vector, slice);
123123+```
124124+125125+---
126126+127127+## Tuples
128128+129129+Fixed-size sets of values of possibly different types:
130130+131131+```rust
132132+// Tuple declaration
133133+let x: (i32, &str, f64) = (1, "hello", 3.4);
134134+135135+// Destructuring
136136+let (a, b, c) = x;
137137+println!("{} {} {}", a, b, c); // 1 hello 3.4
138138+139139+// Indexing
140140+println!("{}", x.1); // hello
141141+```
142142+143143+---
144144+145145+## Structs
146146+147147+Custom data types with named fields:
148148+149149+```rust
150150+struct Point {
151151+ x: i32,
152152+ y: i32,
153153+}
154154+155155+let origin: Point = Point { x: 0, y: 0 };
156156+157157+// Tuple struct (unnamed fields)
158158+struct Point2(i32, i32);
159159+let origin2 = Point2(0, 0);
160160+```
161161+162162+---
163163+164164+## Enums
165165+166166+Enums can have variants with or without data:
167167+168168+```rust
169169+// Basic C-like enum
170170+enum Direction {
171171+ Left,
172172+ Right,
173173+ Up,
174174+ Down,
175175+}
176176+177177+let up = Direction::Up;
178178+179179+// Enum with fields
180180+enum OptionalI32 {
181181+ AnI32(i32),
182182+ Nothing,
183183+}
184184+185185+let two: OptionalI32 = OptionalI32::AnI32(2);
186186+```
187187+188188+---
189189+190190+## Generics
191191+192192+Type parameters for reusable code:
193193+194194+```rust
195195+struct Foo<T> { bar: T }
196196+197197+enum Optional<T> {
198198+ SomeVal(T),
199199+ NoVal,
200200+}
201201+```
202202+203203+The standard library provides `Option<T>` for optional values, replacing null pointers.
204204+205205+---
206206+207207+## Methods
208208+209209+Functions associated with types:
210210+211211+```rust
212212+impl<T> Foo<T> {
213213+ // Borrowed self
214214+ fn bar(&self) -> &T {
215215+ &self.bar
216216+ }
217217+218218+ // Mutably borrowed self
219219+ fn bar_mut(&mut self) -> &mut T {
220220+ &mut self.bar
221221+ }
222222+223223+ // Consumed self
224224+ fn into_bar(self) -> T {
225225+ self.bar
226226+ }
227227+}
228228+```
229229+230230+---
231231+232232+## Traits
233233+234234+Interfaces that define shared behavior:
235235+236236+```rust
237237+trait Frobnicate<T> {
238238+ fn frobnicate(self) -> Option<T>;
239239+}
240240+241241+impl<T> Frobnicate<T> for Foo<T> {
242242+ fn frobnicate(self) -> Option<T> {
243243+ Some(self.bar)
244244+ }
245245+}
246246+247247+let foo = Foo { bar: 1 };
248248+println!("{:?}", foo.frobnicate()); // Some(1)
249249+```
250250+251251+---
252252+253253+## Pattern Matching
254254+255255+Powerful control flow with `match`:
256256+257257+```rust
258258+let foo = OptionalI32::AnI32(1);
259259+match foo {
260260+ OptionalI32::AnI32(n) => println!("it's an i32: {}", n),
261261+ OptionalI32::Nothing => println!("it's nothing!"),
262262+}
263263+```
264264+265265+---
266266+267267+## Advanced Pattern Matching
268268+269269+Destructure and use guards:
270270+271271+```rust
272272+struct FooBar { x: i32, y: OptionalI32 }
273273+let bar = FooBar { x: 15, y: OptionalI32::AnI32(32) };
274274+275275+match bar {
276276+ FooBar { x: 0, y: OptionalI32::AnI32(0) } =>
277277+ println!("The numbers are zero!"),
278278+ FooBar { x: n, y: OptionalI32::AnI32(m) } if n == m =>
279279+ println!("The numbers are the same"),
280280+ FooBar { x: n, y: OptionalI32::AnI32(m) } =>
281281+ println!("Different numbers: {} {}", n, m),
282282+ FooBar { x: _, y: OptionalI32::Nothing } =>
283283+ println!("The second number is Nothing!"),
284284+}
285285+```
286286+287287+---
288288+289289+## For Loops
290290+291291+Iterate over arrays and ranges:
292292+293293+```rust
294294+// Array iteration
295295+let array = [1, 2, 3];
296296+for i in array {
297297+ println!("{}", i);
298298+}
299299+300300+// Range iteration
301301+for i in 0u32..10 {
302302+ print!("{} ", i);
303303+}
304304+// prints: 0 1 2 3 4 5 6 7 8 9
305305+```
306306+307307+---
308308+309309+## If Expressions
310310+311311+`if` can be used as an expression:
312312+313313+```rust
314314+if 1 == 1 {
315315+ println!("Maths is working!");
316316+} else {
317317+ println!("Oh no...");
318318+}
319319+320320+// if as expression
321321+let value = if true {
322322+ "good"
323323+} else {
324324+ "bad"
325325+};
326326+```
327327+328328+---
329329+330330+## Loops
331331+332332+Multiple loop constructs:
333333+334334+```rust
335335+// while loop
336336+while condition {
337337+ println!("Looping...");
338338+ break // Exit the loop
339339+}
340340+341341+// Infinite loop
342342+loop {
343343+ println!("Hello!");
344344+ break // Must break explicitly
345345+}
346346+```
347347+348348+---
349349+350350+## Owned Pointers (Box)
351351+352352+`Box<T>` provides heap allocation with single ownership:
353353+354354+```rust
355355+let mut mine: Box<i32> = Box::new(3);
356356+*mine = 5; // dereference
357357+358358+// Ownership transfer (move)
359359+let mut now_its_mine = mine;
360360+*now_its_mine += 2;
361361+362362+println!("{}", now_its_mine); // 7
363363+// println!("{}", mine); // Error! moved
364364+```
365365+366366+When `Box` goes out of scope, memory is automatically deallocated.
367367+368368+---
369369+370370+## Immutable References
371371+372372+Borrowing without transferring ownership:
373373+374374+```rust
375375+let mut var = 4;
376376+var = 3;
377377+let ref_var: &i32 = &var;
378378+379379+println!("{}", var); // Still works!
380380+println!("{}", *ref_var); // 3
381381+382382+// var = 5; // Error! var is borrowed
383383+// *ref_var = 6; // Error! immutable reference
384384+385385+ref_var; // Use the reference
386386+var = 2; // Borrow ended, can mutate again
387387+```
388388+389389+---
390390+391391+## Mutable References
392392+393393+Exclusive mutable access:
394394+395395+```rust
396396+let mut var2 = 4;
397397+let ref_var2: &mut i32 = &mut var2;
398398+*ref_var2 += 2;
399399+400400+println!("{}", *ref_var2); // 6
401401+402402+// var2 = 2; // Error! var2 is mutably borrowed
403403+404404+ref_var2; // Use ends here
405405+// Now var2 can be used again
406406+```
407407+408408+**Key rule:** Either many immutable references OR one mutable reference.
409409+410410+---
411411+412412+## Memory Safety
413413+414414+Rust's borrow checker ensures:
415415+416416+- No use after free
417417+- No double free
418418+- No data races
419419+- No dangling pointers
420420+421421+All at **compile time** with **zero runtime cost**.
422422+423423+---
424424+425425+## Next Steps
426426+427427+- Explore the [Rust Book](https://doc.rust-lang.org/book/)
428428+- Try [Rust by Example](https://doc.rust-lang.org/rust-by-example/)
429429+- Practice with [Rustlings](https://github.com/rust-lang/rustlings)
430430+- Join the [Rust community](https://www.rust-lang.org/community)
431431+432432+---
433433+434434+## Thank You
435435+436436+Happy Rusting!