From 9273cf57490c7727b3f16b2df7140e62ee99f8a8 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sat, 15 Aug 2020 12:58:01 -0400 Subject: [PATCH] Add list tag --- src/pollen.rkt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/pollen.rkt b/src/pollen.rkt index 317a734..6e6447f 100644 --- a/src/pollen.rkt +++ b/src/pollen.rkt @@ -97,3 +97,18 @@ (make-keyword-procedure (lambda (kws kw-args . elements) (txexpr 'em (zip-kws kws kw-args) elements)))) + +(define (process-list-item item) + (let ((item (string-trim + (string-trim item "-" #:right? #f)))) + (when (and item (non-empty-string? item)) + `(li ,item)))) + +(define list + (make-keyword-procedure + (lambda (kws kw-args . elements) + (txexpr 'ul + (zip-kws kws kw-args) + (filter (lambda (x) (not (void? x))) + (map process-list-item + elements))))))