Sha256: a2225c479583b695ab9dd79630e68d52bfd15032ab10abfb9f6c1f737469a871

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

require "htmlentities"
require "uri" if /^2\./.match?(RUBY_VERSION)

module Asciidoctor
  module ISO
    class Converter < Standoc::Converter
      def clause_parse(attrs, xml, node)
        node.option? "appendix" and return appendix_parse(attrs, xml, node)
        super
      end

      def scope_parse(attrs, xml, node)
        attrs = attrs.merge(type: "scope") unless @amd
        clause_parse(attrs, xml, node)
      end

      def appendix_parse(attrs, xml, node)
        attrs[:"inline-header"] = node.option? "inline-header"
        set_obligation(attrs, node)
        xml.appendix **attr_code(attrs) do |xml_section|
          xml_section.title { |name| name << node.title }
          xml_section << node.content
        end
      end

      def patent_notice_parse(xml, node)
        # xml.patent_notice do |xml_section|
        #  xml_section << node.content
        # end
        xml << node.content
      end

      def sectiontype(node, level = true)
        return nil if @amd

        ret = sectiontype_streamline(sectiontype1(node))
        return ret if ret == "terms and definitions" && @vocab

        super
      end

      def term_def_subclause_parse(attrs, xml, node)
        node.role == "term" and
          return term_def_subclause_parse1(attrs, xml, node)
        super
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
metanorma-iso-1.10.6 lib/asciidoctor/iso/section.rb
metanorma-iso-1.10.5 lib/asciidoctor/iso/section.rb
metanorma-iso-1.10.4 lib/asciidoctor/iso/section.rb
metanorma-iso-1.10.3 lib/asciidoctor/iso/section.rb