Sha256: c6b14ab13989b8d2442401a5e580febe7c25e0b4c0bf9906725095308044e131
Contents?: true
Size: 1.08 KB
Versions: 2
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true module Liquid # @liquid_public_docs # @liquid_type tag # @liquid_category syntax # @liquid_name echo # @liquid_summary # Outputs an expression. # @liquid_description # Using the `echo` tag is the same as wrapping an expression in curly brackets (`{{` and `}}`). However, unlike the curly # bracket method, you can use the `echo` tag inside [`liquid` tags](/docs/api/liquid/tags/liquid). # # > Tip: # > You can use [filters](/docs/api/liquid/filters) on expressions inside `echo` tags. # @liquid_syntax # {% liquid # echo expression # %} # @liquid_syntax_keyword expression The expression to be output. class Echo < Tag attr_reader :variable def initialize(tag_name, markup, parse_context) super @variable = Variable.new(markup, parse_context) end def render(context) @variable.render_to_output_buffer(context, +'') end class ParseTreeVisitor < Liquid::ParseTreeVisitor def children [@node.variable] end end end Template.register_tag('echo', Echo) end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
liquid-5.5.1 | lib/liquid/tags/echo.rb |
liquid-5.5.0 | lib/liquid/tags/echo.rb |