Skip to content

Commit b514898

Browse files
authored
Improve sequential rendering example section
Add for i in (foreach style) rendering example. Also changed section header to be more general as it was just about rendering lists.
1 parent 8960eed commit b514898

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

content/documentation/html-rendering.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,16 @@ To conditionally render parts of the HTML, the `if` expression can be used.
6767
# Evaluates to "<div><p>a</p><p>c</p></div>"
6868
```
6969

70-
## List rendering
70+
## Rendering sequential data structures
7171

72-
Similar to conditional rendering, the `for` expression can be used to render lists.
72+
Similar to conditional rendering, the `for` expression can be used to render iterables such as vectors, lists and sets.
7373

7474
```phel
7575
(html [:ul (for [i :range [0 3]] [:li i])])
7676
# Evaluates to "<ul><li>0</li><li>1</li><li>2</li></ul>"
77+
78+
(html [:ul (for [i :in [3 4 5]] [:li i])])
79+
# Evaluates to "<ul><li>3</li><li>4</li><li>5</li></ul>"
7780
```
7881

7982
## Raw Html

0 commit comments

Comments
 (0)