Sha256: b05fab015244072354f1eebc6d186cc8eaf4e923b9494d66dd896e08762f7f40

Contents?: true

Size: 1.27 KB

Versions: 25

Compression:

Stored size: 1.27 KB

Contents

require_relative "init"
require "isodoc"

module IsoDoc
  module UN
    class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
      def initialize(options)
        super
        @toc = options[:toc]
      end

      def middle_title(docxml); end

      def note1(elem)
        return if elem.parent.name == "bibitem"
        return if elem["type"] == "title-footnote"

        # n = @xrefs.get[f["id"]]
        lbl = case elem["type"]
              when "source" then "Source"
              when "abbreviation" then "Abbreviations"
              else
                @i18n.note
              end
        prefix_name(elem, "", lbl, "name")
      end

      def admonition1(elem)
        return if elem["notag"] == "true"

        n = @xrefs.anchor(elem["id"], :label) or return
        lbl = l10n("#{@i18n.admonition} #{n}")
        prefix_name(elem, block_delim, lbl, "name")
      end

      def annex1(elem)
        lbl = @xrefs.anchor(elem["id"], :label)
        if t = elem.at(ns("./title"))
          t.children = "<strong>#{to_xml(t.children)}</strong>"
        end
        prefix_name(elem, "<br/>", lbl, "title")
      end

      def toc_title(docxml)
        @toc or return
        super
      end

      def move_norm_ref_to_sections(docxml); end

      include Init
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
metanorma-un-0.12.19 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.18 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.17 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.16 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.15 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.14 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.13 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.11 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.10 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.9 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.8 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.7 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.6 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.5 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.4 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.3 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.1 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.12.0 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.11.8 lib/isodoc/un/presentation_xml_convert.rb
metanorma-un-0.11.6 lib/isodoc/un/presentation_xml_convert.rb