Class: Marksman::Writer

Inherits:
Object
  • Object
show all
Defined in:
lib/marksman/writer.rb

Instance Method Summary collapse

Constructor Details

#initialize(file, output_directory, theme = nil) ⇒ Writer

Returns a new instance of Writer.



4
5
6
7
8
# File 'lib/marksman/writer.rb', line 4

def initialize(file, output_directory, theme = nil)
  @file = file
  @output_directory = output_directory
  @theme = theme
end

Instance Method Details

#generateObject



10
11
12
13
14
15
# File 'lib/marksman/writer.rb', line 10

def generate
  presentation = Marksman::Parser.new.parse(@file)
  presentation.theme = Theme.new(@theme) if @theme
  Marksman::Converter.new(presentation).write(@output_directory)
  presentation
end