Sha256: a83c28201d61af02764bd36c896326e00a2f3d60fd063bf431638a8e01f9cfb3
Contents?: true
Size: 903 Bytes
Versions: 4
Compression:
Stored size: 903 Bytes
Contents
module TP class Presenter attr_reader :markdown def initialize(markdown) @markdown = markdown end def present Screen.suggest slide_deck.width, slide_deck.height Keyboard.wait_for_return loop do Renderer.new(slide_deck.current_frame).render case Keyboard.read when :right, :down, :space, :return, 'l', 'k', 'd', 's' slide_deck.next when :left, :up, :backspace, 'h', 'j', 'a', 'w' slide_deck.previous when 'q' break end break if slide_deck.ended? end Screen.clear! end def slides result = markdown.split /^#/ result.reject! &:empty? result.map! { |string| string.prepend "#" } result.map { |string| SlideFactory.from_markdown string } end def slide_deck @slide_deck ||= SlideDeck.new slides end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
tp-0.5.1 | lib/tp/presenter.rb |
tp-0.5.0 | lib/tp/presenter.rb |
tp-0.4.1 | lib/tp/presenter.rb |
tp-0.4.0 | lib/tp/presenter.rb |