From b514898b358dfa6235b409ab73d5c84fef0616f7 Mon Sep 17 00:00:00 2001 From: Jarkko Saltiola Date: Mon, 11 Nov 2024 21:52:50 +0200 Subject: [PATCH] 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. --- content/documentation/html-rendering.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/documentation/html-rendering.md b/content/documentation/html-rendering.md index ce489e91..d98bc11e 100644 --- a/content/documentation/html-rendering.md +++ b/content/documentation/html-rendering.md @@ -67,13 +67,16 @@ To conditionally render parts of the HTML, the `if` expression can be used. # Evaluates to "

a

c

" ``` -## List rendering +## Rendering sequential data structures -Similar to conditional rendering, the `for` expression can be used to render lists. +Similar to conditional rendering, the `for` expression can be used to render iterables such as vectors, lists and sets. ```phel (html [:ul (for [i :range [0 3]] [:li i])]) # Evaluates to "" + +(html [:ul (for [i :in [3 4 5]] [:li i])]) +# Evaluates to "" ``` ## Raw Html