Sha256: c6e0fd24b353a67058700034975f9ae2aa3bb314278342866d0fcaae1b655f54
Contents?: true
Size: 1.77 KB
Versions: 21
Compression:
Stored size: 1.77 KB
Contents
require "isodoc" module IsoDoc module BIPM module BaseConvert attr_accessor :jcgm def configuration Metanorma::BIPM.configuration end TOP_ELEMENTS = IsoDoc::Function::ToWordHtml::TOP_ELEMENTS + " | //doccontrol[@displayorder]".freeze def convert1(docxml, filename, dir) @jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \ "@acronym"))&.value == "JCGM" super end def middle_clause(_docxml) if @jcgm "//clause[parent::sections][not(@type = 'scope')]" \ "[not(descendant::terms)][not(descendant::references)]" else "//sections/*[not(local-name() = 'references')][not(.//references)]" end end def render_identifier(ident) ret = super ret[:sdo] = ret[:sdo]&.sub(/^(BIPM)([ ])(PV|CR)([ ])(\d.*)$/, "\\1\\2<strong>\\3</strong>,\\4\\5") ret end def implicit_reference(bib) b = bib.at(ns("./docidentifier[@primary = 'true'][@type = 'BIPM']")) return true if @doctype == "brochure" && /^(CGPM|CIPM|CCDS|CCTF)[ ] (Resolution|Recommendation|Declaration|Decision|Recommendation|Meeting)/x .match?(b&.text) super end def term_cleanup(docxml) @jcgm ? docxml : super end def error_parse(node, out) case node.name when "blacksquare" then blacksquare_parse(node, out) else super end end def blacksquare_parse(_node, out) out << "■" end def top_element_render(elem, out) case elem.name when "doccontrol" then doccontrol elem, out else super end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems