Class: Ulysses::Printer

Inherits:
Object
  • Object
show all
Defined in:
lib/ulysses/printer.rb

Constant Summary collapse

INLINE_MARKUPS =
%w(strong emph mark delete inlineComment code inlineNative)
SHEET_CONTENT_XPATH =
'/sheet/string[@xml:space="preserve"]'

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ Printer

Returns a new instance of Printer.



7
8
9
10
11
12
# File 'lib/ulysses/printer.rb', line 7

def initialize(target)
  @target        = target
  @footnotes     = []
  @annotations   = []
  @html_entities = HTMLEntities.new
end

Instance Method Details

#annotationsObject



30
31
32
# File 'lib/ulysses/printer.rb', line 30

def annotations
  @annotations
end

#footnotesObject



26
27
28
# File 'lib/ulysses/printer.rb', line 26

def footnotes
  @footnotes
end


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ulysses/printer.rb', line 14

def print
  if @target.is_a? Library
    print_library(@target)
  elsif @target.is_a? Group
    print_group(@target)
  elsif @target.is_a? Sheet
    print_sheet(@target)
  else
    raise "Unsupported print type: #{@target.class}"
  end
end