Sha256: b5b1e23cf642d73905abb8f2d3f0477a1f67b4c70ac0098930ce546b86df51c7

Contents?: true

Size: 1.26 KB

Versions: 10

Compression:

Stored size: 1.26 KB

Contents

require "isodoc"
require "isodoc/generic/word_convert"
require "isodoc/iho/metadata"

module IsoDoc
  module IHO
    # A {Converter} implementation that generates Word output, and a document
    # schema encapsulation of the document for validation
    class WordConvert < IsoDoc::Generic::WordConvert
      def configuration
        Metanorma::IHO.configuration
      end

      def make_body1(body, _docxml)
        body.div **{ class: "WordSection1" } do |div1|
          div1.p **{style: "font-size:0pt;" } do
            |p| p << "&nbsp;" 
          end # placeholder
        end
        section_break(body)
      end

      def make_body2(body, docxml)
        body.div **{ class: "WordSection2" } do |div2|
          boilerplate docxml, div2
          abstract docxml, div2
          foreword docxml, div2
          introduction docxml, div2
          preface docxml, div2
          acknowledgements docxml, div2
          div2.p { |p| p << "&nbsp;" } # placeholder
        end
        section_break(body)
      end

      def authority_cleanup(docxml)
        super
        docxml.xpath("//div[@class = 'boilerplate-feedback']/p").each do |p|
          p["style"] = 'font-size:8pt;font-family:Arial;text-align:right'
        end
      end

      include BaseConvert
    end
  end
end

Version data entries

10 entries across 8 versions & 2 rubygems

Version Path
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-iho-0.1.1/lib/isodoc/iho/word_convert.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-iho-0.1.2/lib/isodoc/iho/word_convert.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/metanorma-iho-0.1.1/lib/isodoc/iho/word_convert.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/metanorma-iho-0.1.2/lib/isodoc/iho/word_convert.rb
metanorma-iho-0.1.2 lib/isodoc/iho/word_convert.rb
metanorma-iho-0.1.1 lib/isodoc/iho/word_convert.rb
metanorma-iho-0.1.0 lib/isodoc/iho/word_convert.rb
metanorma-iho-0.0.3 lib/isodoc/iho/word_convert.rb
metanorma-iho-0.0.2 lib/isodoc/iho/word_convert.rb
metanorma-iho-0.0.1 lib/isodoc/iho/word_convert.rb