class Vimdeck::Ascii

Helper methods for ascii art conversion

Public Class Methods

header(text, type) click to toggle source
# File lib/vimdeck.rb, line 13
def self.header(text, type)
  if font_name = Vimdeck::Slideshow.options[:header_font]
    begin
      font = Artii::Base.new :font => font_name
    rescue
      raise "Incorrect figlet font name"
    end
  else
    if type == "large"
      font = Artii::Base.new :font => 'slant'
    else
      font = Artii::Base.new :font => 'smslant'
    end
  end

  font.asciify(text)
end
image(img) click to toggle source
# File lib/vimdeck.rb, line 31
def self.image(img)
  a = AsciiArt.new(img)
  a.to_ascii_art width: 30
end