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