Sha256: 4f938ce01599e83c2c5252bce5bd5f165e0211bc419208e843ceb70f9612812a
Contents?: true
Size: 1.76 KB
Versions: 16
Compression:
Stored size: 1.76 KB
Contents
require "isodoc" require_relative "metadata" require "fileutils" module IsoDoc module ITU module BaseConvert def nonstd_bibitem(list, bibitem, _ordinal, biblio) list.tr **attr_code(iso_bibitem_entry_attrs(bibitem, biblio)) do |ref| ref.td style: "vertical-align:top" do |td| tag = bibitem.at(ns("./biblio-tag")) tag&.children&.each { |n| parse(n, td) } end ref.td { |td| reference_format(bibitem, td) } end end def std_bibitem_entry(list, bibitem, ordinal, biblio) nonstd_bibitem(list, bibitem, ordinal, biblio) end def biblio_list(clause, div, biblio) div.table class: "biblio", border: "0" do |t| i = 0 t.tbody do |tbody| clause.elements.each do |b| if b.name == "bibitem" next if implicit_reference(b) i += 1 nonstd_bibitem(tbody, b, i, biblio) else unless %w(title clause references).include? b.name tbody.tx { |tx| parse(b, tx) } end end end end end clause.xpath(ns("./clause | ./references")).each do |x| parse(x, div) end end def bracket_if_num(num) return nil if num.nil? num = num.text.sub(/^\[/, "").sub(/\]$/, "") "[#{num}]" end def pref_ref_code(bibitem) ret = bibitem.xpath(ns("./docidentifier[@type = 'ITU']")) ret.empty? and ret = super ret end def unbracket(ident) if ident.respond_to?(:size) ident.map { |x| unbracket1(x) }.join(" | ") else unbracket1(ident) end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems