Sha256: c08ea475214cdc3cc0eb0eb7440286a132d2809e647dc49fc42f4847a955f9e7
Contents?: true
Size: 1.95 KB
Versions: 1
Compression:
Stored size: 1.95 KB
Contents
require_relative "base_convert" require_relative "init" require "isodoc" module IsoDoc module Generic # A {Converter} implementation that generates Word output, and a document # schema encapsulation of the document for validation class WordConvert < IsoDoc::WordConvert def initialize(options) @libdir = File.dirname(__FILE__) super end class << self attr_accessor :_file end def self.inherited( k ) k._file = caller_locations.first.absolute_path end def default_fonts(options) { bodyfont: ( options[:script] == "Hans" ? '"SimSun",serif' : configuration.word_bodyfont || '"Arial",sans-serif' ), headerfont: ( options[:script] == "Hans" ? '"SimHei",sans-serif' : configuration.word_headerfont || '"Arial",sans-serif' ), monospacefont: configuration.word_monospacefont || '"Courier New",monospace' }.transform_values { |v| v&.empty? ? nil : v } end 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 include BaseConvert include Init end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
metanorma-generic-1.7.3 | lib/isodoc/generic/word_convert.rb |