class TP::Slide

Attributes

markdown[R]

Public Class Methods

new(markdown) click to toggle source
# File lib/tp/slide.rb, line 5
def initialize(markdown)
  @markdown = markdown.strip
end

Public Instance Methods

centered_header() click to toggle source
# File lib/tp/slide.rb, line 14
def centered_header
  header.center Screen.width
end
content() click to toggle source
# File lib/tp/slide.rb, line 18
def content
  Array(lines[2, lines.count - 2]).reject { |line|
    line.start_with?("> ")
  }.join
end
frames() click to toggle source
# File lib/tp/slide.rb, line 24
def frames
  [render_terminal]
end
hard_width?() click to toggle source
# File lib/tp/slide.rb, line 48
def hard_width?
  true
end
header() click to toggle source
# File lib/tp/slide.rb, line 9
def header
  line = lines.first
  line[1, line.length - 1].to_s.strip
end
height() click to toggle source
# File lib/tp/slide.rb, line 44
def height
  lines.count
end
lines() click to toggle source
# File lib/tp/slide.rb, line 28
def lines
  markdown.lines.to_a
end
pdf_content_height(pdf) click to toggle source
# File lib/tp/slide.rb, line 32
def pdf_content_height(pdf)
  pdf.bounds.height - pdf_header_height
end
pdf_content_top_left(pdf) click to toggle source
# File lib/tp/slide.rb, line 36
def pdf_content_top_left(pdf)
  [pdf.bounds.left, pdf.bounds.top - pdf_header_height]
end
pdf_header_height() click to toggle source
# File lib/tp/slide.rb, line 40
def pdf_header_height
  header != "" ? 1.in : 0
end