mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 00:55:11 -07:00
Document break tag theme rendering behavior
Co-authored-by: Pi AI (openai/gpt-5.1) <[email protected]>
This commit is contained in:
@@ -3,19 +3,31 @@
|
|||||||
module Liquid
|
module Liquid
|
||||||
# Break tag to be used to break out of a for loop.
|
# Break tag to be used to break out of a for loop.
|
||||||
#
|
#
|
||||||
# == Basic Usage:
|
# == Iteration usage:
|
||||||
# {% for item in collection %}
|
# {% for item in collection %}
|
||||||
# {% if item.condition %}
|
# {% if item.condition %}
|
||||||
# {% break %}
|
# {% break %}
|
||||||
# {% endif %}
|
# {% endif %}
|
||||||
# {% endfor %}
|
# {% endfor %}
|
||||||
#
|
#
|
||||||
|
# == Theme file rendering usage:
|
||||||
|
# {% if condition %}
|
||||||
|
# {% break %}
|
||||||
|
# {% endif %}
|
||||||
|
#
|
||||||
# @liquid_public_docs
|
# @liquid_public_docs
|
||||||
# @liquid_type tag
|
# @liquid_type tag
|
||||||
# @liquid_category iteration
|
# @liquid_category iteration
|
||||||
# @liquid_name break
|
# @liquid_name break
|
||||||
# @liquid_summary
|
# @liquid_summary
|
||||||
# Stops a [`for` loop](/docs/api/liquid/tags/for) from iterating.
|
# Stops a [`for` loop](/docs/api/liquid/tags/for) from iterating, or stops the
|
||||||
|
# rest of a file from rendering when used outside of a loop.
|
||||||
|
# @liquid_description
|
||||||
|
# Inside a `for` or `tablerow` loop, `break` stops the loop.
|
||||||
|
#
|
||||||
|
# Outside of a loop, `break` stops the rest of the current file from
|
||||||
|
# rendering. Sections, blocks, and snippets each render in their own context, so
|
||||||
|
# rendering continues normally in the file that rendered them.
|
||||||
# @liquid_syntax
|
# @liquid_syntax
|
||||||
# {% break %}
|
# {% break %}
|
||||||
class Break < Tag
|
class Break < Tag
|
||||||
|
|||||||
Reference in New Issue
Block a user