Class: TP::Slide
- Inherits:
-
Object
show all
- Defined in:
- lib/tp/slide.rb
Defined Under Namespace
Classes: Bulleted, Code, HeaderOnly, Paragraph
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(markdown) ⇒ Slide
Returns a new instance of Slide.
5
6
7
|
# File 'lib/tp/slide.rb', line 5
def initialize(markdown)
@markdown = markdown.strip
end
|
Instance Attribute Details
#markdown ⇒ Object
Returns the value of attribute markdown.
3
4
5
|
# File 'lib/tp/slide.rb', line 3
def markdown
@markdown
end
|
Instance Method Details
14
15
16
|
# File 'lib/tp/slide.rb', line 14
def
.center Screen.width
end
|
#content ⇒ Object
18
19
20
|
# File 'lib/tp/slide.rb', line 18
def content
Array(lines[2, lines.count - 2]).join
end
|
#frames ⇒ Object
22
23
24
|
# File 'lib/tp/slide.rb', line 22
def frames
[render_terminal]
end
|
#hard_width? ⇒ Boolean
46
47
48
|
# File 'lib/tp/slide.rb', line 46
def hard_width?
true
end
|
9
10
11
12
|
# File 'lib/tp/slide.rb', line 9
def
line = lines.first
line[1, line.length - 1].to_s.strip
end
|
#height ⇒ Object
42
43
44
|
# File 'lib/tp/slide.rb', line 42
def height
lines.count
end
|
#lines ⇒ Object
26
27
28
|
# File 'lib/tp/slide.rb', line 26
def lines
markdown.lines.to_a
end
|
#pdf_content_height(pdf) ⇒ Object
30
31
32
|
# File 'lib/tp/slide.rb', line 30
def pdf_content_height(pdf)
pdf.bounds.height -
end
|
#pdf_content_top_left(pdf) ⇒ Object
34
35
36
|
# File 'lib/tp/slide.rb', line 34
def pdf_content_top_left(pdf)
[pdf.bounds.left, pdf.bounds.top - ]
end
|
38
39
40
|
# File 'lib/tp/slide.rb', line 38
def
!= "" ? 1.in : 0
end
|