code / slides

Lines549 Python392 Markdown127 make18 Text12
(170 lines)

#!./slides.py

Slides Demo

by Bruce Hill

slides is a terminal slide presenter.

You can see the slide number in the bottom left corner.

Slides are separated by three or more dashes on a line: ---

To advance to the next slide, press Right or Space or J.


Slide Navigation

You can go back a slide by pressing Left or Backspace or K.

You can go to the first slide by pressing Home or H.

You can go to the last slide by pressing End or L.

You can also type in a slide number and hit Enter to go to that slide.


Basic Features

This is italic, bold, and inline code The paragraph continues on line two.

  • A list
  • With items
  1. and
  2. some
  3. numbered ones

Block quote that spans multiple lines

Here's a shell example:

ls --color=auto

Demos

For runnable demos, you can use ```demo and press Enter to run the demo

seq 1000 | less

Another demo:

for i in `seq 5`; do
    echo "$i"
    sleep 1
done
echo "DONE"

Syntax Highlighting

Some code:

def sing_bottles(n:int):
    for i in reversed(range(n)):
        if i > 1:
            print(f"{i} bottles of beer on the wall,")
            print(f"{i} bottles of beer!")
            print("Take one down, pass it around...")
        elif i == 1:
            print("One bottle of beer on the wall,")
            print("One bottle of beer!")
            print("Take it down, pass it around...")
        else:
            print("No more bottles of beer on the wall!")
            print("Go to the store, buy some more...")
            sing_bottles(n)
This is some *markdown* text with **asterisks**.
Some basic emojis: 🌎💨🔥
They do render correctly with appropriate box size
(But your mileage may vary, depending on how your
terminal renders emojis and what font you use)

Embedding files

You can embed files with the syntax ![title](./file.txt):

You can scroll up/down with Up/Down, the mouse wheel, or Ctrl-U/Ctrl-D.

Tale of Genji

The source for this presentation


Images

Supported! (kinda)


Re-running Code

You can re-run code by pressing Ctrl-R or R.

It is currently:

date

Some random numbers:

openssl rand -hex 16
hexdump -n 128 /dev/urandom

Inspecting the Source

You can inspect a slide's code at any point using the Backtick key `

hexdump -n 128 /dev/urandom

Get the Code

You can get the source code at the github repo

(links are [link text](url), press Enter to launch)


The End

Thanks for your time!

1 #!./slides.py
3 # Slides Demo
5 *by Bruce Hill*
7 **slides** is a terminal slide presenter.
9 You can see the slide number in the bottom left corner.
11 Slides are separated by three or more dashes on a line: `---`
13 To advance to the next slide, press **Right** or **Space** or **J**.
15 ---------------------------------------------------------
17 # Slide Navigation
19 You can go back a slide by pressing **Left** or **Backspace** or **K**.
21 You can go to the *first* slide by pressing **Home** or **H**.
23 You can go to the *last* slide by pressing **End** or **L**.
25 You can also type in a slide number and hit **Enter** to go to that slide.
27 ---------------------------------------------------------
29 # Basic Features
31 This is **italic**, *bold*, and `inline code`
32 The paragraph continues on line two.
34 - A list
35 - With items
37 1. and
38 2. some
39 3. numbered ones
41 > Block quote
42 > that spans multiple lines
44 Here's a shell example:
46 ```run
47 ls --color=auto
48 ```
50 ---------------------------------------------------------
52 # Demos
54 For runnable demos, you can use ```` ```demo ````
55 and press **Enter** to run the demo
57 ```demo
58 seq 1000 | less
59 ```
61 Another demo:
63 ```demo
64 for i in `seq 5`; do
65 echo "$i"
66 sleep 1
67 done
68 echo "DONE"
69 ```
71 ---------------------------------------------------------
73 # Syntax Highlighting
75 Some code:
77 ```Python
78 def sing_bottles(n:int):
79 for i in reversed(range(n)):
80 if i > 1:
81 print(f"{i} bottles of beer on the wall,")
82 print(f"{i} bottles of beer!")
83 print("Take one down, pass it around...")
84 elif i == 1:
85 print("One bottle of beer on the wall,")
86 print("One bottle of beer!")
87 print("Take it down, pass it around...")
88 else:
89 print("No more bottles of beer on the wall!")
90 print("Go to the store, buy some more...")
91 sing_bottles(n)
92 ```
94 ```markdown
95 This is some *markdown* text with **asterisks**.
96 ```
98 ```
99 Some basic emojis: 🌎💨🔥
100 They do render correctly with appropriate box size
101 (But your mileage may vary, depending on how your
102 terminal renders emojis and what font you use)
103 ```
105 ---------------------------------------------------------
107 # Embedding files
109 You can embed files with the syntax `![title](./file.txt)`:
111 You can scroll up/down with **Up**/**Down**, the **mouse wheel**, or **Ctrl-U**/**Ctrl-D**.
113 ![Tale of Genji](genji.txt)
115 ![The source for this presentation](sample.md)
117 ---------------------------------------------------------
119 # Images
121 ![](thumbsup.jpg)
123 Supported! (kinda)
125 ---------------------------------------------------------
127 # Re-running Code
129 You can re-run code by pressing **Ctrl-R** or **R**.
131 It is currently:
133 ```run
134 date
135 ```
137 Some random numbers:
139 ```run
140 openssl rand -hex 16
141 ```
143 ```run
144 hexdump -n 128 /dev/urandom
145 ```
147 ---------------------------------------------------------
149 # Inspecting the Source
151 You can inspect a slide's code at any point using
152 the **Backtick** key `` ` ``
154 ```run
155 hexdump -n 128 /dev/urandom
156 ```
158 ---------------------------------------------------------
160 # Get the Code
162 You can get the source code [at the github repo](https://github.com/bruce-hill/slides)
164 (links are `[link text](url)`, press **Enter** to launch)
166 ---------------------------------------------------------
168 # The End
170 Thanks for your time!