Sha256: 0e285f28374e102acd6d84ef71ab82f4e089ff377a1cf47bd6acaa73d4e33dea
Contents?: true
Size: 1.37 KB
Versions: 6
Compression:
Stored size: 1.37 KB
Contents
require_relative "init" require "isodoc" module IsoDoc module ITU class PresentationXMLConvert < IsoDoc::PresentationXMLConvert def initialize(options) @hierarchical_assets = options[:hierarchical_assets] super end def prefix_container(container, linkend, _target) l10n("#{linkend} #{@i18n.get["in"]} #{@xrefs.anchor(container, :xref)}") end def eref(docxml) docxml.xpath(ns("//eref")).each do |f| eref1(f) end end def origin(docxml) docxml.xpath(ns("//origin[not(termref)]")).each do |f| eref1(f) end end def quotesource(docxml) docxml.xpath(ns("//quote/source")).each do |f| eref1(f) end end def eref1(f) get_eref_linkend(f) end def get_eref_linkend(node) contents = non_locality_elems(node).select do |c| !c.text? || /\S/.match(c) end return unless contents.empty? link = anchor_linkend(node, docid_l10n(node["target"] || node["citeas"])) link && !/^\[.*\]$/.match(link) and link = "[#{link}]" link += eref_localities(node.xpath(ns("./locality | ./localityStack")), link) non_locality_elems(node).each { |n| n.remove } node.add_child(link) end include Init end end end
Version data entries
6 entries across 6 versions & 2 rubygems