join

.join iterable:{Iterable<Any>} \
separator:{InlineMarkdownContent = InlineMarkdownContent(listOf(Text(", ")))} \
body:{Lambda? = null}
-> Node

Merges the elements of a collection into a single inline content, placing separator between adjacent elements.

.var {letters}
- A
- B
- C

.letters::join <!-- A, B, C -->

Like forEach, a body can transform each element before joining:

.letters::withindices::join
index letter:
.index **.letter**

Output: 1 A, 2 B, 3 C

Return

the output of all iterations, joined by separator

Parameters

iterable

collection to iterate

separator

inline content placed between the output of adjacent iterations. Defaults to ,

body

the inline output of each iteration. Accepts 1 parameter (the current element). If unset, each element is output as is

Chaining

This function is designed to be chained with other function calls:
Iterable<Any>::join separator:{InlineMarkdownContent} \
body:{Lambda?}
-> Node

Wiki page

loops