class IsoDoc::BSI::PresentationXMLConvert
Public Instance Methods
annex1(elem)
click to toggle source
# File lib/isodoc/bsi/presentation_xml_convert.rb, line 82 def annex1(elem) lbl = @xrefs.anchor(elem["id"], :label) if t = elem.at(ns("./title")) t.children = "<strong>#{t.children.to_xml}</strong>" end prefix_name(elem, "<br/>", lbl, "title") end
block(docxml)
click to toggle source
Calls superclass method
# File lib/isodoc/bsi/presentation_xml_convert.rb, line 7 def block(docxml) super commentary(docxml) end
clause(docxml)
click to toggle source
Calls superclass method
# File lib/isodoc/bsi/presentation_xml_convert.rb, line 69 def clause(docxml) super ids = docxml.xpath(ns("//bibdata/relation[@type = 'related']/bibitem")) .each_with_object([]) { |x, m| m << x.at(ns("./docidentifier")).text } return if ids.empty? docxml.at(ns("//preface")).elements.first.previous = <<~SECTION <clause type="related-refs"> <p>#{@i18n.related_refs}<br/>#{ids.join('<br/>')}</p> </clause> SECTION end
commentary(docxml)
click to toggle source
# File lib/isodoc/bsi/presentation_xml_convert.rb, line 16 def commentary(docxml) docxml.xpath(ns("//admonition[@type = 'commentary']")).each do |f| commentary1(f) end end
commentary1(node)
click to toggle source
introduce name element
# File lib/isodoc/bsi/presentation_xml_convert.rb, line 23 def commentary1(node) n = @xrefs.get[node["id"]] prefix_name(node, "", n[:label].upcase, "name") end
eref_localities1(target, type, from, to, delim, node, lang = "en")
click to toggle source
# File lib/isodoc/bsi/presentation_xml_convert.rb, line 46 def eref_localities1(target, type, from, to, delim, node, lang = "en") return "" if type == "anchor" subsection = from&.text&.match(/\./) type = type.downcase lang == "zh" and return l10n(eref_localities1_zh(target, type, from, to, node, delim)) ret = if delim == ";" ";" else type == "list" ? "" : delim end ret += eref_locality_populate(type, node) unless subsection && type == "clause" || type == "list" || target.match(/^IEV$|^IEC 60050-/) range = " #{from.text}" if from range += "–#{to.text}" if to range &&= "<strong>#{range}</strong>" if type == "clause" ret += " #{range}" ret += ")" if type == "list" l10n(ret) end
eref_localities1_zh(target, type, from, to, node, delim)
click to toggle source
# File lib/isodoc/bsi/presentation_xml_convert.rb, line 28 def eref_localities1_zh(target, type, from, to, node, delim) subsection = from&.text&.match(/\./) ret = if delim == ";" ";" else type == "list" ? "" : delim end ret += " 第#{from.text}" if from ret += "–#{to.text}" if to ret = "<strong>#{ret}</strong>" if type == "clause" loc = (@i18n.locality[type] || type.sub(/^locality:/, "").capitalize) ret += " #{loc}" unless subsection && type == "clause" || type == "list" || target.match(/^IEV$|^IEC 60050-/) || node["droploc"] == "true" ret += ")" if type == "list" ret end
termnote1(termnote)
click to toggle source
# File lib/isodoc/bsi/presentation_xml_convert.rb, line 12 def termnote1(termnote) note1(termnote) end