lib/isodoc/gb/gbwordconvert.rb in asciidoctor-gb-0.3.2 vs lib/isodoc/gb/gbwordconvert.rb in asciidoctor-gb-0.3.3

- old
+ new

@@ -1,9 +1,9 @@ require "isodoc" require_relative "gbconvert" require_relative "gbcleanup" -require_relative "agencies" +require "gb_agencies" require_relative "metadata" require_relative "gbwordrender" module IsoDoc module Gb @@ -27,11 +27,11 @@ "$bodyfont: #{b};\n$headerfont: #{h};\n$monospacefont: #{m};\n$titlefont: #{t};\n" end def metadata_init(lang, script, labels) @meta = Metadata.new(lang, script, labels) - @common = IsoDoc::Gb::Common.new(meta: @meta) + @common = IsoDoc::Gb::Common.new(meta: @meta) end def html_doc_path(file) File.join(File.dirname(__FILE__), File.join("html", file)) end @@ -44,18 +44,24 @@ @header = html_doc_path("header.html") @wordcoverpage = html_doc_path("word_gb_titlepage.html") @wordintropage = html_doc_path("word_gb_intro.html") @ulstyle = "l7" @olstyle = "l10" + @lang = "zh" + @script = "Hans" end - def metadata_init(lang, script, labels) + def metadata_init(lang, script, labels) + unless ["en", "zh"].include? lang + lang = "zh" + script = "Hans" + end @meta = Metadata.new(lang, script, labels) @common = IsoDoc::Gb::Common.new(meta: @meta) end - def cleanup(docxml) + def cleanup(docxml) @cleanup = Cleanup.new(@script, @deprecated_lbl) super @cleanup.cleanup(docxml) docxml end @@ -125,26 +131,9 @@ word_preface(docxml) word_annex_cleanup(docxml) @cleanup.title_cleanup(docxml.at('//div[@class="WordSection2"]')) docxml end - - #def word_intro(docxml) - #super - #title_cleanup(docxml.at('//div[@class="WordSection2"]')) - #end - -=begin - def toWord(result, filename, dir) - result = populate_template(result, :word) - result = from_xhtml(word_cleanup(to_xhtml(result))) - Html2Doc.process(result, filename: filename, - stylesheet: @wordstylesheet, - header_file: "header.html", dir: dir, - asciimathdelims: [@openmathdelim, @closemathdelim], - liststyles: {ul: "l7", ol: "l10"}) - end -=end def html_doc_path(file) File.join(File.dirname(__FILE__), File.join("html", file)) end end