Method: IsoDoc::WordFunction::Postprocess#toWord

Defined in:
lib/isodoc/word_function/postprocess.rb

#toWord(result, filename, dir, header) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/isodoc/word_function/postprocess.rb', line 38

def toWord(result, filename, dir, header)
  result = from_xhtml(word_cleanup(to_xhtml(result)))
  unless @landscapestyle.empty?
    @wordstylesheet&.open
    @wordstylesheet&.write(@landscapestyle)
    @wordstylesheet&.close
  end
  Html2Doc.process(result, filename: filename, stylesheet: @wordstylesheet&.path,
                   header_file: header&.path, dir: dir,
                   asciimathdelims: [@openmathdelim, @closemathdelim],
                   liststyles: { ul: @ulstyle, ol: @olstyle })
  header&.unlink
  @wordstylesheet&.unlink
end