Sha256: 3debd93c481ad092063eeef30fb382f3a589979d9c0598e3e0ed2127629ef205

Contents?: true

Size: 651 Bytes

Versions: 16

Compression:

Stored size: 651 Bytes

Contents

# frozen_string_literal: true

module DocTemplate
  module Tags
    class SmpTag < BlockTag
      TAG_NAME = 'smp'
      TEMPLATES = { default: 'smp.html.erb',
                    gdoc: 'gdoc/smp.html.erb' }.freeze

      def parse(node, opts = {})
        nodes = block_nodes node
        nodes.each(&:remove)

        params = {
          content: parse_nested(nodes.map(&:to_html).join, opts),
          smp: opts[:value].split(';').map(&:strip)
        }
        @content = parse_template(params, template_name(opts))
        replace_tag node
        self
      end
    end
  end

  Template.register_tag(Tags::SmpTag::TAG_NAME, Tags::SmpTag)
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.5.4 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.5.3 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.5.2 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.5.1 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.5.0 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.4.2 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.4.1 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.4.0 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.3.1 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.1.4 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.3.0 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.1.3 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.2.0 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.1.2 lib/doc_template/tags/smp_tag.rb
lcms-engine-0.1.0 lib/doc_template/tags/smp_tag.rb