Class: DocxConverter::Render
- Inherits:
-
Object
- Object
- DocxConverter::Render
- Defined in:
- lib/docx_converter/render.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Render
constructor
A new instance of Render.
- #render(output_format) ⇒ Object
Constructor Details
#initialize(options) ⇒ Render
Returns a new instance of Render.
23 24 25 26 27 28 |
# File 'lib/docx_converter/render.rb', line 23 def initialize() @options = @output_dir = [:output_dir] @chapters = nil end |
Instance Method Details
#render(output_format) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/docx_converter/render.rb', line 30 def render(output_format) FileUtils.mkdir_p(File.join(@output_dir, @options[:image_subdir_filesystem])) output = DocxConverter::Parser.new(@options).parse content = output[:content] footnote_definitions = output[:footnote_definitions] p = DocxConverter::PostProcessor.new(content, footnote_definitions) p.join_blockquotes if @options[:split_chapters] == true p.split_into_chapters end p.add_foonote_definitions @chapters = p.chapters case output_format when :kramdown filepaths = render_kramdown when :html filepaths = render_html when :latex filepaths = render_latex else filepaths = [] end return filepaths end |