Sha256: 6c7d0599b3023a0939f7604ff2263dbb6d38b6c5444db21d8e2f6d90f8c90a82

Contents?: true

Size: 938 Bytes

Versions: 34

Compression:

Stored size: 938 Bytes

Contents

require "isodoc"
require "mn2sts"

module IsoDoc
  module Iso

    # A {Converter} implementation that generates HTML output, and a document
    # schema encapsulation of the document for validation
    #
    class StsConvert < IsoDoc::XslfoPdfConvert
      def initialize(options)
        @libdir = File.dirname(__FILE__)
        @format = :sts
        @suffix = "sts.xml"
      end

      def convert(input_filename, file = nil, debug = false, output_filename = nil)
        file = File.read(input_filename, encoding: "utf-8") if file.nil?
        docxml, filename, dir = convert_init(file, input_filename, debug)
        /\.xml$/.match(input_filename) or
          input_filename = Tempfile.open([filename, ".xml"], encoding: "utf-8") do |f|
          f.write file
          f.path
        end
        FileUtils.rm_rf dir
        Mn2sts.convert(input_filename, output_filename || "#{filename}.#{@suffix}")
      end
    end
  end
end

Version data entries

34 entries across 31 versions & 2 rubygems

Version Path
metanorma-iso-1.8.1 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.8.0 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.7.4 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.7.3 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.7.2 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.7.1 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.7.0 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.6.1 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.6.0 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.14 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.13 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.12 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.11 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.10 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.9 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.8 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.7 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.6 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.5 lib/isodoc/iso/sts_convert.rb
metanorma-iso-1.5.4 lib/isodoc/iso/sts_convert.rb