class IsoDoc::Generic::WordConvert

A {Converter} implementation that generates Word output, and a document schema encapsulation of the document for validation

Attributes

_file[RW]

Public Class Methods

inherited( k ) click to toggle source
# File lib/isodoc/generic/word_convert.rb, line 20
def self.inherited( k )
  k._file = caller_locations.first.absolute_path
end
new(options) click to toggle source
Calls superclass method
# File lib/isodoc/generic/word_convert.rb, line 11
def initialize(options)
  @libdir = File.dirname(__FILE__)
  super
end

Public Instance Methods

default_file_locations(options) click to toggle source
# File lib/isodoc/generic/word_convert.rb, line 42
def default_file_locations(options)
  {
    wordstylesheet: baselocation(configuration.wordstylesheet) ||
    html_doc_path("wordstyle.scss"),
    standardstylesheet: baselocation(configuration.standardstylesheet) ||
    html_doc_path("generic.scss"),
    header: baselocation(configuration.header) ||
    html_doc_path("header.html"),
    wordcoverpage: baselocation(configuration.wordcoverpage) ||
    html_doc_path("word_generic_titlepage.html"),
    wordintropage: baselocation(configuration.wordintropage) ||
    html_doc_path("word_generic_intro.html"),
    i18nyaml: (configuration.i18nyaml.is_a?(String) ?
               baselocation(configuration.i18nyaml) : nil),
  ulstyle: "l3",
  olstyle: "l2",
  }.transform_values { |v| v&.empty? ? nil : v }
end
default_fonts(options) click to toggle source
# File lib/isodoc/generic/word_convert.rb, line 24
def default_fonts(options)
  {
    bodyfont: (
      options[:script] == "Hans" ? '"Source Han Sans",serif' : 
      configuration.word_bodyfont || '"Arial",sans-serif'
    ),
    headerfont: (
      options[:script] == "Hans" ? '"Source Han Sans",sans-serif' : 
      configuration.word_headerfont ||  '"Arial",sans-serif'
    ),
    monospacefont:  configuration.word_monospacefont ||  '"Courier New",monospace',
    normalfontsize: configuration.word_normalfontsize,
    smallerfontsize: configuration.word_smallerfontsize,
    footnotefontsize: configuration.word_footnotefontsize,
    monospacefontsize: configuration.word_monospacefontsize,
  }.transform_values { |v| v&.empty? ? nil : v  }
end