Sha256: ff60d82c7074e1d9fe7d52e81d00a5abc8aa833bfde55f53ebffbfa1c4c28092
Contents?: true
Size: 1.71 KB
Versions: 1
Compression:
Stored size: 1.71 KB
Contents
module IsoDoc module NIST module BaseConvert NIST_PUBLISHER_XPATH = "./contributor[xmlns:role/@type = 'publisher']/"\ "organization[abbreviation = 'NIST' or xmlns:name = 'NIST']".freeze # we are taking the ref number/code out as prefix to reference def nonstd_bibitem(list, b, ordinal, bibliography) list.p **attr_code(iso_bibitem_entry_attrs(b, bibliography)) do |r| if !b.at(ns("./formattedref")) nist_reference_format(b, r) else reference_format(b, r) end end end def std_bibitem_entry(list, b, ordinal, biblio) nonstd_bibitem(list, b, ordinal, biblio) end def reference_format(b, r) id = bibitem_ref_code(b) code = render_identifier(id) if code[0] r << "#{code[0]} " insert_tab(r, 1) end reference_format1(b, r) r << " [#{code[1]}] " if code[1] end def reference_format1(b, r) if ftitle = b.at(ns("./formattedref")) ftitle&.children&.each { |n| parse(n, r) } else title = b.at(ns("./title[@language = '#{@language}']")) || b.at(ns("./title")) r.i do |i| title&.children&.each { |n| parse(n, i) } end end end def bracket_if_num(x) return nil if x.nil? x = x.text.sub(/^\[/, "").sub(/\]$/, "") "[#{x}]" end def omit_docid_prefix(prefix) return true if prefix.nil? || prefix.empty? super || prefix == "NIST" end def nist_reference_format(b, r) bibitem = b.dup.to_xml r.parent.add_child ::Iso690Render.render(bibitem, true) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
metanorma-nist-1.0.8 | lib/isodoc/nist/refs.rb |