class IsoDoc::BIPM::PdfConvert

document schema encapsulation of the document for validation
A {Converter} implementation that generates PDF HTML output, and a

def configuration

def configuration
  Metanorma::BIPM.configuration
end

def initialize(options)

def initialize(options)
  @libdir = File.dirname(__FILE__)
  super
end

def pdf_options(docxml)

def pdf_options(docxml)
  n = configuration.document_namespace
  q = "//m:bipm-standard/m:bibdata/m:language[@current = 'true']"
  if docxml.root.name == "metanorma-collection" &&
      docxml.at("#{q}[. = 'fr']", "m" => n) &&
      docxml.at("#{q}[. = 'en']", "m" => n)
    return super.tap do |h|
      h["--split-by-language"] = nil
    end
  end
  super
end

def pdf_stylesheet(docxml)

def pdf_stylesheet(docxml)
  docxml&.at(ns("//bibdata/ext/editorialgroup/committee/@acronym"))
  &.value == "JCGM" and
    return "jcgm.standard.xsl"
  doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
  doctype = "brochure" unless %w(guide mise-en-pratique rapport)
    .include? doctype
  "bipm.#{doctype}.xsl"
end