Sha256: 44babdd57ee5549e39de61643b2832035e5e74bb17c0aeb13a906d5871d6396d

Contents?: true

Size: 1.35 KB

Versions: 2

Compression:

Stored size: 1.35 KB

Contents

require "metanorma/processor"

module Metanorma
  module NIST
    class Processor < Metanorma::Processor
      def initialize
        @short = :nist
        @input_format = :asciidoc
        @asciidoctor_backend = :nist
      end

      def output_formats
        super.merge(
          html: "html",
          doc: "doc",
          pdf: "pdf"
        )
      end

      def fonts_manifest
        {
          "Arial" => nil,
          "Calibri" => nil,
          "Cambria" => nil,
          "Courier" => nil,
          "Courier New" => nil,
          "SimSun" => nil,
          "SimHei" => nil,
          "STIX Two Math" => nil,
          "Times New Roman" => nil,
        }
      end

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metanorma-nist-1.2.11 lib/metanorma/nist/processor.rb
metanorma-nist-1.2.10 lib/metanorma/nist/processor.rb