Sha256: fbee465b037a79a7d94c324a4721159de620ce0f0e7a738451c86a8b29ba90fd

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

require "isodoc"
require "metanorma-iso"
require_relative "base_convert"
require_relative "init"

module IsoDoc
  module Iec
    class HtmlConvert < IsoDoc::Iso::HtmlConvert
      def initialize(options)
        super
        @libdir = File.dirname(__FILE__)
      end

      def default_fonts(options)
        {
          bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' : '"Arial",sans-serif'),
        headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' : '"Arial",sans-serif'),
        monospacefont: ('"Courier New",monospace'),
        monospacefontsize: "1.0em",
        footnotefontsize: "0.9em",
        }
      end

      def default_file_locations(options)
        @libdir = File.dirname(__FILE__)
        {
          htmlstylesheet: html_doc_path("htmlstyle.scss"),
          htmlcoverpage: html_doc_path("html_iec_titlepage.html"),
          htmlintropage: html_doc_path("html_iec_intro.html"),
          scripts: html_doc_path("scripts.html"),
        }
      end

      def htmlstyle(docxml)
        docxml = super
        b = docxml.at("div[@class = 'boilerplate_legal']/ol")
        b and b["type"] = "1"
        docxml
      end

      def authority_cleanup(docxml)
        auth = docxml.at("//div[@id = 'boilerplate-feedback' or @class = 'boilerplate-feedback']")
        auth&.remove
        super
      end

      include BaseConvert
      include Init
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
metanorma-iec-1.2.17 lib/isodoc/iec/html_convert.rb
metanorma-iec-1.2.16 lib/isodoc/iec/html_convert.rb
metanorma-iec-1.2.15 lib/isodoc/iec/html_convert.rb
metanorma-iec-1.2.14 lib/isodoc/iec/html_convert.rb
metanorma-iec-1.2.13 lib/isodoc/iec/html_convert.rb