Sha256: 23b5e5a61422be0d25d0fe98a79905aaa282c8143b4a0497d058bf961d52e7ce
Contents?: true
Size: 708 Bytes
Versions: 16
Compression:
Stored size: 708 Bytes
Contents
# frozen_string_literal: true module DocTemplate module Tags class PositionTag < TableTag TAG_NAME = 'position' TEMPLATE = 'position.html.erb' def parse_table(table) table.remove && return unless @opts[:parent_tags].try(:include?, Tags::MaterialsTag::TAG_NAME) params = { content: table.at_xpath('.//tr[2]/td').inner_html, position: @opts[:value].strip } content = parse_template params, TEMPLATE @content = parse_nested(content, @opts) replace_tag table end end end # TODO: Currently will work only inside materials tag Template.register_tag(Tags::PositionTag::TAG_NAME, Tags::PositionTag) end
Version data entries
16 entries across 16 versions & 1 rubygems