-
Notifications
You must be signed in to change notification settings - Fork 7
Iterable
Iterable values are ordered lists or unordered set that can be iterated through a loop.
An ordered or unordered Markdown list is automatically converted to an ordered iterable.
Note
This feature is currently limited:
- The text content of each item is used as a dynamic value, allowing it to be adapted to any other type as invocation time;
- Nested lists are not supported.
.var {letters}
- A
- B
- C
.foreach {.letters}
.lowercase {.1}
a
b
c
A pair is an iterable of two values.
It may be created via .pair {first} {second}
or retrieved from a Dictionary's entry.
When used in a function which requires an iterable, a Dictionary value is used as a list of key-value pairs.
An integer Range
is a valid ordered iterable value.
When iterating via .foreach
, if the elements are yet other iterables, using more than 1 lambda parameter lets the element be destructured into its components.
In the following example we iterate over a dictionary, which is an iterable of pairs (which are iterables):
.var {x}
.dictionary
- a: 1
- b: 2
- c: 3
.foreach {.x}
key value: <!-- 2 lambda parameters, one per pair component -->
**.key** has value **.value**
- Syntax of a function call
- Declaring functions
- Dynamic typing
- Localization
- Including other Quarkdown files
- Importing external libraries
- Document metadata
- Theme
- Page format
- Page margin content
- Page counter
- Automatic page break
- Numbering
- Table of contents
- Stacks (row, column, grid)
- Align
- Container
- Box
- Collapsible
- Whitespace
- String
- Number
- Markdown content
- Boolean
- Enumeration entry
- Iterable
- Dictionary
- Range
- Lambda
- Size(s)
- Color
- Dynamic