pmd/docs/_plugins/render_block.rb
2020-02-05 20:46:17 +01:00

19 lines
354 B
Ruby

require 'pp'
#
# Tags to create a complex object inline in JSON.
#
class RenderBlock < Liquid::Block
def initialize(tag_name, arg, tokens)
super
@body = tokens
end
def render(context)
template = @body.render(context)
Liquid::Template.parse(template).render(context)
end
end
Liquid::Template.register_tag('render', RenderBlock)