-
Notifications
You must be signed in to change notification settings - Fork 7
Iterable
Giorgio Garofalo edited this page Dec 11, 2024
·
10 revisions
Iterable values are ordered lists or unordered set that can be iterated through a loop.
Iterables can be destructured: see Destructuring for more.
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.
The following operations on iterables are valid (note that indexes start at 1):
.getat {index} {iterable}
-
.getat {index} {iterable} {orelse}
(fallback value if the index is out of bounds) .first {iterable}
.second {iterable}
.third {iterable}
.last {iterable}
- 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