przn 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/sample/sample.md CHANGED
@@ -1,69 +1,310 @@
1
- # przn
1
+ # przn {counter=hide}
2
2
 
3
3
  A terminal presentation tool written in Ruby
4
4
 
5
- # Features
5
+ # Slide format
6
6
 
7
- - **Markdown** based slides
8
- - *Kitty text sizing* protocol support
9
- - Simple keyboard navigation
7
+ Every <color=cyan>`# h1`</color> starts a new slide.
10
8
 
11
- # Code Blocks
9
+ Below the heading you can write **bold**, *italic*, `inline code`, ~~strikethrough~~, and the usual markdown.
10
+
11
+ # Lists
12
+
13
+ Unordered, ordered, and nested:
14
+
15
+ - pick a fruit
16
+ - or a vegetable
17
+ - leafy ones too
18
+ - something else
19
+
20
+ 1. first
21
+ 2. second
22
+ 3. third
23
+
24
+ # Code blocks
12
25
 
13
26
  ```ruby
14
- puts "Hello from przn!"
27
+ class Slide
28
+ attr_reader :title, :body
29
+ end
15
30
  ```
16
31
 
17
- # Inline Formatting
32
+ ```python
33
+ def fib(n):
34
+ return n if n < 2 else fib(n-1) + fib(n-2)
35
+ ```
18
36
 
19
- This is **bold**, this is *italic*, and this is `inline code`.
37
+ # Code blocks — per-line stepping `{lines=…|…}`
20
38
 
21
- > This is a blockquote
39
+ ```ruby {lines=1|2-3|4-5}
40
+ class Slide
41
+ attr_reader :title, :body
42
+ def initialize(title:, body: "")
43
+ @title, @body = title, body
44
+ end
45
+ end
46
+ ```
22
47
 
23
- # Lists
48
+ Press Space → the highlight walks: line 1, then 2-3, then 4-5.
49
+
50
+ # Block quotes
51
+
52
+ > Code is read more often than it is written.
53
+
54
+ > Tables, lists, and the rest of standard markdown render normally.
55
+
56
+ # Tables
57
+
58
+ | Language | Year | Designer |
59
+ |----------|------|----------|
60
+ | Ruby | 1995 | Matz |
61
+ | Python | 1991 | Guido |
62
+ | Lisp | 1958 | McCarthy |
63
+
64
+ # Definition lists
65
+
66
+ term
67
+ : definition for the term
68
+
69
+ another term
70
+ : another definition
71
+
72
+ # Text sizing — `<size=N>`
73
+
74
+ <size=xx-small>xx-small</size> <size=x-small>x-small</size> <size=small>small</size> <size=large>large</size>
75
+
76
+ <size=x-large>x-large</size> text
77
+
78
+ <size=xx-large>xx-large</size> text
79
+
80
+ <size=xxx-large>xxx-large</size> text
81
+
82
+ <size=xxxx-large>biggest</size> text
83
+
84
+ # Color — `<color=NAME>`
85
+
86
+ <color=red>red</color>, <color=green>green</color>, <color=yellow>yellow</color>, <color=blue>blue</color>, <color=magenta>magenta</color>, <color=cyan>cyan</color>
87
+
88
+ Plus 6-digit hex: <color=ff5555>tomato-ish</color>, <color=50fa7b>mint</color>, <color=8be9fd>sky</color>
89
+
90
+ # Font — `<font>`
91
+
92
+ <font face="Helvetica Neue" size="x-large">Helvetica Neue</font>
93
+
94
+ <font face="Menlo" color="green" size="large">monospace in green</font>
95
+
96
+ <font face="Georgia" size="xx-large" color="cyan">all three</font> at once
97
+
98
+ # Alignment — `<center>` / `<right>`
99
+
100
+ <center>centered line</center>
101
+
102
+ <right>right-aligned line</right>
103
+
104
+ The bare paragraph stays left-aligned for contrast.
105
+
106
+ # Slide background — `<bg>`
107
+
108
+ <bg color="#1a1a2e"/>
109
+
110
+ A `<bg>` directive applies for this slide only. The next slide reverts.
111
+
112
+ # Background — gradient
113
+
114
+ <bg from="#1a1a2e" to="#16213e" angle="90"/>
115
+
116
+ `<bg from="..." to="..." angle="..."/>` ships a linear gradient (Echoes' OSC 7772).
117
+
118
+ # Background — image
119
+
120
+ <bg image="ruby.png"/>
121
+
122
+ `<bg image="ruby.png"/>` uses the Kitty Graphics Protocol at `z: -1` so text layers on top.
123
+
124
+ # Image — flow (intrinsic size)
125
+
126
+ <img src="ruby.png"/>
127
+
128
+ # Image — relative_height="70"
129
+
130
+ <img src="ruby.png" relative_height="70"/>
131
+
132
+ # Image — width="N%"
133
+
134
+ <img src="ruby.png" width="40%"/>
135
+
136
+ # Image — absolute position
137
+
138
+ <img src="ruby.png" x="5c" y="3c" relative_height="40"/>
139
+ <img src="ruby.png" x="50%" y="50%" relative_height="40"/>
140
+
141
+ # Image — alignment keywords
142
+
143
+ <img src="ruby.png" x="left" y="top" relative_height="20"/>
144
+ <img src="ruby.png" x="center" y="top" relative_height="20"/>
145
+ <img src="ruby.png" x="right" y="top" relative_height="20"/>
146
+ <img src="ruby.png" x="left" y="bottom" relative_height="20"/>
147
+ <img src="ruby.png" x="center" y="bottom" relative_height="20"/>
148
+ <img src="ruby.png" x="right" y="bottom" relative_height="20"/>
149
+
150
+ # Absolute-position text — `<at>`
151
+
152
+ <at x="5" y="5">top-left ish</at>
153
+ <at x="40" y="15"><size=x-large>BIG</size></at>
154
+ <at x="60" y="20"><color=red>warn</color></at>
155
+ <at x="50%" y="50%"><font face="Georgia" size="xx-large" color="cyan">dead center</font></at>
156
+
157
+ # `<at>` — alignment keywords
158
+
159
+ <at x="left" y="top">top-left</at>
160
+ <at x="center" y="top">top-center</at>
161
+ <at x="right" y="top">top-right</at>
162
+ <at x="left" y="center">middle-left</at>
163
+ <at x="center" y="center"><font face="Georgia" size="xx-large">middle</font></at>
164
+ <at x="right" y="center">middle-right</at>
165
+ <at x="left" y="bottom">bottom-left</at>
166
+ <at x="center" y="bottom">bottom-center</at>
167
+ <at x="right" y="bottom">bottom-right</at>
168
+
169
+ # Shapes and Lines
170
+
171
+ <rect x="10" y="5" width="20" height="6" rx="1" fill="tomato"/>
172
+ <circle cx="60%" cy="40%" r="6" fill="gold"/>
173
+ <ellipse cx="85%" cy="40%" rx="8" ry="4" fill="cyan"/>
174
+ <line x1="10" y1="20" x2="70" y2="20" stroke="white" stroke-width="0.3"/>
175
+ <arrow x1="10" y1="24" x2="70" y2="24" stroke="cyan" stroke-width="0.4"/>
176
+ <polyline points="10,26 25,28 40,26 55,28 70,26" stroke="lime" stroke-width="0.4" fill="none"/>
177
+ <polygon points="50%,3 60%,15 50%,20 40%,15" fill="orange"/>
178
+ <path d="M 30 27 C 45 23 55 31 70 27" stroke="white" stroke-width="0.4" fill="none"/>
179
+
180
+ # Two columns {layout=two-column}
181
+
182
+ left side
183
+
184
+ - bullet A
185
+ - bullet B
186
+
187
+ <slot/>
188
+
189
+ right side
190
+
191
+ - bullet C
192
+ - bullet D
193
+
194
+ # Takahashi method {layout=takahashi}
195
+
196
+ たかはし
197
+
198
+ # Title only {layout=title-only}
199
+
200
+ # Comments
201
+
202
+ <!-- this comment is hidden; the slide renders only the prose below -->
203
+
204
+ Comments use `<!-- ... -->` (single-line or multi-line) and never appear on the rendered slide.
205
+
206
+ # Speaker notes
207
+
208
+ The next sentence has a hidden side-strip note. <note>this never appears on the audience screen</note> Everything around the note still shows.
209
+
210
+ The note is visible in `--present` mode on the presenter pane.
211
+
212
+ # Step builds — `<wait/>`
213
+
214
+ A `<wait/>` on its own line splits the slide into steps.
215
+
216
+ <wait/>
217
+
218
+ Press Space again — the next group reveals.
219
+
220
+ <wait/>
221
+
222
+ And again — the layout doesn't reflow, the hidden text was already reserved.
223
+
224
+ # Step builds — inline `<wait/>` in a list
225
+
226
+ - foo
227
+ - <wait/>bar
228
+ - <wait/>baz
229
+
230
+ The same step boundary, scoped to a single list item — the bullets stay in one list (numbering and indentation intact), and each `<wait/>` walks one item in.
231
+
232
+ # Slide transition — fade _(Echoes only)_ {transition=fade}
233
+
234
+ The h1 IAL `{transition=fade}` opts this slide into a fade transition. Press → to leave: the text smoothly fades to nothing before the next slide arrives.
235
+
236
+ # …and fades back in {transition=fade}
237
+
238
+ This slide also opts in, so the previous one fades out AND this one fades in. Either side can opt in independently — leave one off and that half snaps.
239
+
240
+ `theme.transition.duration` (ms) controls the per-half speed; default 200ms.
241
+
242
+ # Fragment animations — directional fades
243
+
244
+ <at x="10" y="40%" fragment="fade-up">fade-up</at>
245
+ <at x="30" y="40%" fragment="fade-down">fade-down</at>
246
+ <at x="50" y="40%" fragment="fade-left">fade-left</at>
247
+ <at x="70" y="40%" fragment="fade-right">fade-right</at>
248
+
249
+ Each `<at fragment="…">` adds a step boundary — press → to walk them in, one by one. The text slides into its declared spot while fading from alpha 0 to 1.
250
+
251
+ # Cross-slide ref — `<ref id=…/>`
252
+
253
+ <at id="quote" x="center" y="40%">🤘 Fall to your knees and repent if you please</at>
254
+
255
+ Declared once above. The next slide ref's it in place — and again, moved.
256
+
257
+ # …same quote, re-used
258
+
259
+ <ref id="quote"/>
260
+ <ref id="quote" y="80%"/>
261
+
262
+ The text comes from the previous slide; the second `<ref>` overrides `y=`.
263
+
264
+ # Composite reuse — `<group>`
265
+
266
+ <group id="callout">
267
+ <rect x="30%" y="50%" width="40%" height="6" fill="tomato" opacity="0.3" stroke="tomato"/>
268
+ <at x="center" y="55%">Watch this part →</at>
269
+ </group>
270
+
271
+ A rectangle plus a caption, bundled. Press Space →
24
272
 
25
- - First item
26
- - Second item
27
- - Third item
273
+ # …re-used as one bundle
28
274
 
29
- 1. Ordered one
30
- 2. Ordered two
31
- 3. Ordered three
275
+ <ref id="callout"/>
32
276
 
33
- # Custom Styling
277
+ Both the rect and the caption land in the same place — declared once.
34
278
 
35
- {::tag name="xx-large"}BIG text{:/tag}
279
+ # Actions — `<action>`
36
280
 
37
- {::tag name="x-large"}large text{:/tag}
281
+ <arrow id="arrow" x1="15" y1="27" x2="15" y2="20" stroke="cyan" stroke-width="0.5"/>
38
282
 
39
- {::tag name="large"}large text{:/tag}
283
+ A vertical arrow points up, well below the text. Press Space to step it across.
40
284
 
41
- normal and {::tag name="red"}red text{:/tag} mixed
285
+ <wait/>
42
286
 
43
- # Image (PNG)
287
+ <action target="arrow" x1="50" x2="50" duration="500ms"/>
44
288
 
45
- ![](doge.png){:relative_height="70"}
289
+ <wait/>
46
290
 
47
- # Image (JPG)
291
+ <action target="arrow" x1="85" x2="85" duration="500ms"/>
48
292
 
49
- ![](doge.jpg){:relative_height="70"}
293
+ # Fade — `<action opacity=…>` _(Echoes only)_
50
294
 
51
- # Image (XML form)
295
+ <at id="msg-out" x="center" y="40%">This message will fade out.</at>
296
+ <at id="msg-in" x="center" y="60%" opacity="0">…and this one fades in.</at>
52
297
 
53
- <img src="doge.png" relative_height="70"/>
298
+ Press Space to step through the fade.
54
299
 
55
- # Image (absolute position)
300
+ <wait/>
56
301
 
57
- <img src="doge.png" x="5" y="3" relative_height="40"/>
58
- <img src="doge.png" x="50%" y="50%" relative_height="40"/>
302
+ <action target="msg-out" opacity="0" duration="1s"/>
59
303
 
60
- # Absolute-position text
304
+ <wait/>
61
305
 
62
- <at x="10" y="10">top-left ish</at>
63
- <at x="40" y="15"><size=3>BIG</size></at>
64
- <at x="80" y="25"><color=red>warn</color></at>
65
- <at x="50%" y="50%">dead center</at>
306
+ <action target="msg-in" opacity="1" duration="1s"/>
66
307
 
67
- # Thank You!
308
+ # Thank you
68
309
 
69
- That's all! Enjoy!
310
+ That's all — enjoy.
data/sample/shapes.md ADDED
@@ -0,0 +1,55 @@
1
+ # Shapes Examples
2
+
3
+ # Lines (1)
4
+ <line x1="10" y1="6" x2="70" y2="6" stroke="white" stroke-width="0.3"/>
5
+
6
+ # Lines (2)
7
+ <line x1="10" y1="10" x2="70" y2="14" stroke="cyan" stroke-width="0.4"/>
8
+
9
+ # Lines (3)
10
+ <line x1="10" y1="20" x2="70" y2="16" stroke="purple" stroke-width="0.5"/>
11
+
12
+ # Rectangles (1)
13
+ <rect x="10" y="5" width="20" height="6" fill="tomato"/>
14
+
15
+ # Rectangles (2)
16
+ <rect x="35" y="5" width="20" height="6" rx="1" fill="cyan"/>
17
+
18
+ # Rectangles (3)
19
+ <rect x="60" y="5" width="15" height="6" fill="none" stroke="gold" stroke-width="0.4"/>
20
+
21
+ # Circles (1)
22
+ <circle cx="20%" cy="50%" r="5" fill="tomato"/>
23
+
24
+ # Circles (2)
25
+ <circle cx="50%" cy="50%" r="6" fill="none" stroke="lavender" stroke-width="0.5"/>
26
+
27
+ # Ellipses
28
+ <ellipse cx="80%" cy="50%" rx="8" ry="4" fill="gold"/>
29
+
30
+ # Polylines
31
+ <polyline points="10,8 25,18 40,8 55,18 70,8" stroke="lime" stroke-width="0.4" fill="none"/>
32
+
33
+ # Polygons
34
+ <polygon points="50%,3 60%,15 50%,20 40%,15" fill="gold"/>
35
+
36
+ # Arrows
37
+ <arrow x1="10" y1="6" x2="70" y2="6" stroke="cyan" stroke-width="0.4"/>
38
+ <arrow x1="10" y1="12" x2="70" y2="18" stroke="yellow" stroke-width="0.5"/>
39
+ <arrow x1="40" y1="22" x2="40" y2="6" stroke="red" stroke-width="0.4"/>
40
+
41
+ # Paths
42
+
43
+ <path d="M 10 5 L 70 5 L 40 25 Z" fill="cyan" stroke="white" stroke-width="0.3"/>
44
+
45
+ # Path — cubic Bezier curve
46
+
47
+ <path d="M 10 20 C 25 5 55 5 70 20" stroke="orange" stroke-width="0.4" fill="none"/>
48
+
49
+ # Mixed composition
50
+ <line x1="5" y1="50%" x2="75" y2="50%" stroke="white" stroke-width="0.3"/>
51
+ <circle cx="20" cy="50%" r="2" fill="tomato"/>
52
+ <circle cx="40" cy="50%" r="2" fill="cyan"/>
53
+ <circle cx="60" cy="50%" r="2" fill="gold"/>
54
+
55
+ A timeline of three events.
metadata CHANGED
@@ -1,103 +1,117 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: przn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
- - Akira Matsuda
7
+ - Akira Matsuda
8
8
  bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: prawn
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- -
17
- - ">="
18
- - !ruby/object:Gem::Version
19
- version: "0"
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- -
25
- - ">="
26
- - !ruby/object:Gem::Version
27
- version: "0"
28
- - !ruby/object:Gem::Dependency
29
- name: hexapdf
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- -
33
- - ">="
34
- - !ruby/object:Gem::Version
35
- version: "0"
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- -
41
- - ">="
42
- - !ruby/object:Gem::Version
43
- version: "0"
44
- description: A terminal-based presentation tool that renders Markdown slides with Kitty text sizing protocol support for beautifully scaled headers
12
+ - !ruby/object:Gem::Dependency
13
+ name: prawn
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: hexapdf
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: rouge
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ description: A terminal-based presentation tool that renders Markdown slides with
55
+ Kitty text sizing protocol support for beautifully scaled headers
45
56
  email:
46
- - ronnie@dio.jp
57
+ - ronnie@dio.jp
47
58
  executables:
48
- - przn
59
+ - przn
49
60
  extensions: []
50
61
  extra_rdoc_files: []
51
62
  files:
52
- - LICENSE.txt
53
- - README.md
54
- - Rakefile
55
- - default_theme.yml
56
- - exe/przn
57
- - lib/przn.rb
58
- - lib/przn/audience_link.rb
59
- - lib/przn/controller.rb
60
- - lib/przn/echoes_client.rb
61
- - lib/przn/image_util.rb
62
- - lib/przn/kitty_text.rb
63
- - lib/przn/parser.rb
64
- - lib/przn/prawn_pdf_exporter.rb
65
- - lib/przn/presentation.rb
66
- - lib/przn/presenter_renderer.rb
67
- - lib/przn/renderer.rb
68
- - lib/przn/screenshot_pdf_exporter.rb
69
- - lib/przn/slide.rb
70
- - lib/przn/terminal.rb
71
- - lib/przn/theme.rb
72
- - lib/przn/version.rb
73
- - sample/doge.jpg
74
- - sample/doge.png
75
- - sample/sample.md
76
- - sig/przn.rbs
77
- homepage: "https://github.com/amatsuda/przn"
63
+ - LICENSE.txt
64
+ - README.md
65
+ - Rakefile
66
+ - default_theme.yml
67
+ - exe/przn
68
+ - lib/przn.rb
69
+ - lib/przn/audience_link.rb
70
+ - lib/przn/code_highlighter.rb
71
+ - lib/przn/controller.rb
72
+ - lib/przn/echoes_client.rb
73
+ - lib/przn/file_watcher.rb
74
+ - lib/przn/image_util.rb
75
+ - lib/przn/kitty_text.rb
76
+ - lib/przn/mermaid_renderer.rb
77
+ - lib/przn/parser.rb
78
+ - lib/przn/prawn_pdf_exporter.rb
79
+ - lib/przn/presentation.rb
80
+ - lib/przn/presenter_renderer.rb
81
+ - lib/przn/renderer.rb
82
+ - lib/przn/screenshot_pdf_exporter.rb
83
+ - lib/przn/slide.rb
84
+ - lib/przn/terminal.rb
85
+ - lib/przn/theme.rb
86
+ - lib/przn/version.rb
87
+ - sample/ruby-logo-LICENSE
88
+ - sample/ruby.jpg
89
+ - sample/ruby.png
90
+ - sample/sample.md
91
+ - sample/shapes.md
92
+ - sig/przn.rbs
93
+ homepage: https://github.com/amatsuda/przn
78
94
  licenses:
79
- - MIT
95
+ - MIT
80
96
  metadata:
81
- allowed_push_host: "https://rubygems.org"
82
- source_code_uri: "https://github.com/amatsuda/przn"
83
- homepage_uri: "https://github.com/amatsuda/przn"
97
+ allowed_push_host: https://rubygems.org
98
+ source_code_uri: https://github.com/amatsuda/przn
99
+ homepage_uri: https://github.com/amatsuda/przn
84
100
  rdoc_options: []
85
101
  require_paths:
86
- - lib
102
+ - lib
87
103
  required_ruby_version: !ruby/object:Gem::Requirement
88
104
  requirements:
89
- -
90
- - ">="
91
- - !ruby/object:Gem::Version
92
- version: "0"
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
93
108
  required_rubygems_version: !ruby/object:Gem::Requirement
94
109
  requirements:
95
- -
96
- - ">="
97
- - !ruby/object:Gem::Version
98
- version: "0"
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
99
113
  requirements: []
100
- rubygems_version: 4.1.0.dev
114
+ rubygems_version: 4.0.20
101
115
  specification_version: 4
102
116
  summary: Terminal presentation tool
103
117
  test_files: []
data/sample/doge.jpg DELETED
Binary file
data/sample/doge.png DELETED
Binary file