Sha256: 52b2cc7d38a02c4ab9baebcbf7f753206d863fa64395340d53768ea090e41ea4

Contents?: true

Size: 753 Bytes

Versions: 2

Compression:

Stored size: 753 Bytes

Contents

require "isodoc"

module IsoDoc
  module BIPM
    # A {Converter} implementation that generates PDF HTML output, and a
    # document schema encapsulation of the document for validation
    class PdfConvert <  IsoDoc::XslfoPdfConvert
      def initialize(options)
        @libdir = File.dirname(__FILE__)
        super
      end

      def pdf_stylesheet(docxml)
        doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
        doctype = "brochure" unless %w(guide mise-en-pratique rapport).
          include? doctype
        "bipm.#{doctype}.xsl"
      end

      def pdf_options(docxml)
        if docxml.root.name == "metanorma-collection"
          "--split-by-language"
        else
          super
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metanorma-bipm-0.0.5 lib/isodoc/bipm/pdf_convert.rb
metanorma-bipm-0.0.4 lib/isodoc/bipm/pdf_convert.rb