/ learning / presenterm / demo.md
demo.md
  1  ---
  2  title: Introducing _presenterm_
  3  author: Matias
  4  ---
  5  
  6  Customizability
  7  ---
  8  
  9  _presenterm_ allows configuring almost anything about your presentation:
 10  
 11  * The colors used.
 12  * Layouts.
 13  * Footers, including images in the footer.
 14  
 15  <!-- pause -->
 16  
 17  This is an example on how to configure a footer:
 18  
 19  ```yaml
 20  footer:
 21    style: template
 22    left:
 23      image: doge.png
 24    center: '<span class="noice">Colored</span> _footer_'
 25    right: "{current_slide} / {total_slides}"
 26    height: 5
 27  
 28  palette:
 29    classes:
 30      noice:
 31        foreground: red
 32  ```
 33  
 34  <!-- end_slide -->
 35  
 36  Headers
 37  ---
 38  
 39  Markdown headers can be used to set slide titles like:
 40  
 41  ```markdown
 42  Headers
 43  -------
 44  ```
 45  
 46  # Headers
 47  
 48  Each header type can be styled differently.
 49  
 50  ## Subheaders
 51  
 52  ### And more
 53  
 54  <!-- end_slide -->
 55  
 56  Code highlighting
 57  ---
 58  
 59  Highlight code in 50+ programming languages:
 60  
 61  ```rust
 62  // Rust
 63  fn greet() -> &'static str {
 64      "hi mom"
 65  }
 66  ```
 67  
 68  ```python
 69  # Python
 70  def greet() -> str:
 71      return "hi mom"
 72  ```
 73  
 74  <!-- pause -->
 75  
 76  -------
 77  
 78  Code snippets can have different styles including no background:
 79  
 80  ```cpp +no_background +line_numbers
 81  // C++
 82  string greet() {
 83      return "hi mom";
 84  }
 85  ```
 86  
 87  <!-- end_slide -->
 88  
 89  Dynamic code highlighting
 90  ---
 91  
 92  Dynamically highlight different subsets of lines:
 93  
 94  ```rust {1-4|6-10|all} +line_numbers
 95  #[derive(Clone, Debug)]
 96  struct Person {
 97      name: String,
 98  }
 99  
100  impl Person {
101      fn say_hello(&self) {
102          println!("hello, I'm {}", self.name)
103      }
104  }
105  ```
106  
107  <!-- end_slide -->
108  
109  Snippet execution
110  ---
111  
112  Code snippets can be executed on demand:
113  
114  * For 20+ languages, including compiled ones.
115  * Display their output in real time.
116  * Comment out unimportant lines to hide them.
117  
118  ```rust +exec
119  # use std::thread::sleep;
120  # use std::time::Duration;
121  fn main() {
122      let names = ["Alice", "Bob", "Eve", "Mallory", "Trent"];
123      for name in names {
124          println!("Hi {name}!");
125          sleep(Duration::from_millis(500));
126      }
127  }
128  ```
129  
130  <!-- end_slide -->
131  
132  Images
133  ---
134  
135  Images and animated gifs are supported in terminals such as:
136  
137  * kitty
138  * iterm2
139  * wezterm
140  * ghostty
141  * Any sixel enabled terminal
142  
143  <!-- column_layout: [1, 3, 1] -->
144  
145  <!-- column: 1 -->
146  
147  ![](doge.png)
148  
149  _Picture by Alexis Bailey / CC BY-NC 4.0_
150  
151  <!-- end_slide -->
152  
153  Column layouts
154  ---
155  
156  <!-- column_layout: [7, 3] -->
157  
158  <!-- column: 0 -->
159  
160  Use column layouts to structure your presentation:
161  
162  * Define the number of columns.
163  * Adjust column widths as needed.
164  * Write content into every column.
165  
166  ```rust
167  fn potato() -> u32 {
168      42
169  }
170  ```
171  
172  <!-- column: 1 -->
173  
174  ![](doge.png)
175  
176  <!-- reset_layout -->
177  
178  ---
179  
180  Layouts can be reset at any time.
181  
182  ```python
183  print("Hello world!")
184  ```
185  
186  <!-- end_slide -->
187  
188  Text formatting
189  ---
190  
191  Text formatting works including:
192  
193  * **Bold text**.
194  * _Italics_.
195  * **_Bold and italic_**.
196  * ~Strikethrough~.
197  * `Inline code`.
198  * Links [](https://example.com/)
199  * <span style="color: red">Colored</span> text.
200  * <span style="color: blue; background-color: black">Background color</span> can be changed too.
201  
202  <!-- end_slide -->
203  
204  More markdown
205  ---
206  
207  Other markdown elements supported are:
208  
209  # Block quotes
210  
211  > Lorem ipsum dolor sit amet. Eos laudantium animi ut ipsam beataeet
212  > et exercitationem deleniti et quia maiores a cumque enim et
213  > aspernatur nesciunt sed adipisci quis.
214  
215  # Alerts
216  
217  > [!caution]
218  > Github style alerts
219  
220  # Tables
221  
222  | Name   | Taste  |
223  | ------ | ------ |
224  | Potato | Great  |
225  | Carrot | Yuck   |
226  
227  <!-- end_slide -->
228  
229  <!-- jump_to_middle -->
230  
231  The end
232  ---