Sha256: c90fc7a2b52ee35e749e897616490fc2968a978818883c81d2946729a8b76753

Contents?: true

Size: 1.48 KB

Versions: 26

Compression:

Stored size: 1.48 KB

Contents

require "metanorma/processor"

module Metanorma
  module BIPM
    class Processor < Metanorma::Generic::Processor
      def configuration
        Metanorma::BIPM.configuration
      end

      def output_formats
        super.merge(
          html: "html",
          pdf: "pdf",
        ).tap { |hs| hs.delete(:doc) }
      end

      def fonts_manifest
        {
          "Arial" => nil,
          "Times New Roman" => nil,
          "Work Sans" => nil,
          "Work Sans Black" => nil,
          "Work Sans ExtraBold" => nil,
          "Work Sans ExtraLight" => nil,
          "Work Sans Light" => nil,
          "Work Sans Medium" => nil,
          "Work Sans SemiBold" => nil,
          "Work Sans Thin" => nil,
          "STIX Two Math" => nil,
          "Source Han Sans" => nil,
          "Source Han Sans Normal" => nil,
          "TeXGyreChorus" => nil,
        }
      end

      def version
        "Metanorma::BIPM #{Metanorma::BIPM::VERSION}"
      end

      def output(isodoc_node, inname, outname, format, options = {})
        case format
        when :html
          IsoDoc::BIPM::HtmlConvert.new(options)
            .convert(inname, isodoc_node, nil, outname)
        when :presentation
          IsoDoc::BIPM::PresentationXMLConvert.new(options)
            .convert(inname, isodoc_node, nil, outname)
        when :pdf
          IsoDoc::BIPM::PdfConvert.new(options)
            .convert(inname, isodoc_node, nil, outname)
        else
          super
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
metanorma-bipm-2.3.2 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.3.1 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.3.0 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.14 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.13 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.12 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.11 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.10 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.9 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.8 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.7 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.6 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.5 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.4 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.3 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.2 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.1 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.2.0 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.1.13 lib/metanorma/bipm/processor.rb
metanorma-bipm-2.1.12 lib/metanorma/bipm/processor.rb