diff --git a/lib/liquid/tags/cycle.rb b/lib/liquid/tags/cycle.rb index 96f0d570..cfe18fc5 100644 --- a/lib/liquid/tags/cycle.rb +++ b/lib/liquid/tags/cycle.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +# @public_docs module Liquid # Cycle is usually used within a loop to alternate between values, like colors or DOM classes. # @@ -13,6 +14,16 @@ module Liquid #
Item four
#
Item five
# + # @public_docs + # @title Cycle + # @syntax The syntax + # @summary Loops through a group of strings and prints them in the order that they were passed as arguments. + # @type tag + # @description + # Loops through a group of strings and prints them in the order that they were passed as arguments. + # Each time `cycle`` is called, the next string argument is printed. + # + # `cycle` must be used within a `for`` loop block. class Cycle < Tag SimpleSyntax = /\A#{QuotedFragment}+/o NamedSyntax = /\A(#{QuotedFragment})\s*\:\s*(.*)/om diff --git a/lib/liquid/tags/for.rb b/lib/liquid/tags/for.rb index 328ba02a..1b01d751 100644 --- a/lib/liquid/tags/for.rb +++ b/lib/liquid/tags/for.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +# @public_docs module Liquid # "For" iterates over an array or collection. # Several useful variables are available to you within the loop. @@ -45,6 +46,12 @@ module Liquid # forloop.last:: Returns true if the item is the last item. # forloop.parentloop:: Provides access to the parent loop, if present. # + # @public_docs + # @title For + # @syntax The syntax + # @summary Repeatedly executes a block of code. + # @type tag + # @description The description class For < Block Syntax = /\A(#{VariableSegment}+)\s+in\s+(#{QuotedFragment}+)\s*(reversed)?/o