Sha256: c0d4038d8439da0f36a62a7f42f7d8978e2f0fb1ad95d019bfec1042ef40dabe

Contents?: true

Size: 1.32 KB

Versions: 6

Compression:

Stored size: 1.32 KB

Contents

require_relative "init"
require "isodoc"
require "metanorma-generic"

module IsoDoc
  module Ribose
    class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
      def annex1(elem)
        lbl = @xrefs.anchor(elem["id"], :label)
        prefix_name(elem, "<br/><br/>", lbl, "title")
      end

      def termsource1(elem)
        mod = elem.at(ns("./modification")) and
          termsource_modification(mod)
        elem.children = l10n("<strong>#{@i18n.source}:</strong> " \
                             "#{to_xml(elem.children).strip}")
        elem&.next_element&.name == "termsource" and elem.next = "; "
      end

      def preface_rearrange(doc)
        preface_move(doc.at(ns("//preface/abstract")),
                     %w(foreword executivesummary introduction clause acknowledgements), doc)
        preface_move(doc.at(ns("//preface/foreword")),
                     %w(executivesummary introduction clause acknowledgements), doc)
        preface_move(doc.at(ns("//preface/executivesummary")),
                     %w(introduction clause acknowledgements), doc)
        preface_move(doc.at(ns("//preface/introduction")),
                     %w(clause acknowledgements), doc)
        preface_move(doc.at(ns("//preface/acknowledgements")),
                     %w(), doc)
      end

      include Init
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
metanorma-ribose-2.2.13 lib/isodoc/ribose/presentation_xml_convert.rb
metanorma-ribose-2.2.12 lib/isodoc/ribose/presentation_xml_convert.rb
metanorma-ribose-2.2.11 lib/isodoc/ribose/presentation_xml_convert.rb
metanorma-ribose-2.2.10 lib/isodoc/ribose/presentation_xml_convert.rb
metanorma-ribose-2.2.9 lib/isodoc/ribose/presentation_xml_convert.rb
metanorma-ribose-2.2.8 lib/isodoc/ribose/presentation_xml_convert.rb