Class: IsoDoc::Bipm::PdfConvert
- Inherits:
-
Generic::PdfConvert
- Object
- Generic::PdfConvert
- IsoDoc::Bipm::PdfConvert
- Includes:
- BaseConvert, Init
- Defined in:
- lib/isodoc/bipm/pdf_convert.rb
Instance Attribute Summary
Attributes included from BaseConvert
Instance Method Summary collapse
-
#initialize(options) ⇒ PdfConvert
constructor
A new instance of PdfConvert.
- #pdf_options(docxml, filename) ⇒ Object
- #pdf_stylesheet(docxml) ⇒ Object
Methods included from BaseConvert
#configuration, #convert1, #middle_clause, #table_footnote?, #term_cleanup
Methods included from Init
#amd?, #bibrenderer, #i18n_init, #metadata_init, #xref_init
Constructor Details
#initialize(options) ⇒ PdfConvert
Returns a new instance of PdfConvert.
8 9 10 11 |
# File 'lib/isodoc/bipm/pdf_convert.rb', line 8 def initialize() super @libdir = File.dirname(__FILE__) end |
Instance Method Details
#pdf_options(docxml, filename) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/isodoc/bipm/pdf_convert.rb', line 24 def (docxml, filename) n = configuration.document_namespace q = "//m:metanorma/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 |
#pdf_stylesheet(docxml) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/isodoc/bipm/pdf_convert.rb', line 13 def pdf_stylesheet(docxml) docxml&.at(ns("//bibdata/ext/editorialgroup/committee/@acronym")) &.value == "JCGM" and return "jcgm.standard.xsl" doctype = @doctype doctype = "brochure" unless %w(guide mise-en-pratique rapport) .include? doctype "bipm.#{doctype}.xsl" end |