commit 1b5e1f56fd214f0e4d6c532b8e6f9313d5057966 parent 8cd1f7f9b6972a3a413d3050db8de16c4ff317ba Author: Daniel Barlow <dan@telent.net> Date: Mon, 28 Jul 2025 00:23:57 +0100 export string-stream from lib module Diffstat:
| M | html.fnl | | | 7 | +------ |
| M | lib.fnl | | | 9 | ++++++++- |
| M | main.fnl | | | 1 | + |
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/html.fnl b/html.fnl @@ -1,9 +1,4 @@ -(fn string-stream [] - (let [strings []] - { - :write #(table.insert strings $2) - :to-string (table.concat strings) - })) +(local {: string-stream } (require :lib)) (fn to-html [el out-stream] (if (not out-stream) diff --git a/lib.fnl b/lib.fnl @@ -2,4 +2,11 @@ (doto tbl (table.insert 1 head))) -{ : prepend } +(fn string-stream [] + (let [strings []] + { + :write #(table.insert strings $2) + :to-string #(table.concat strings) + })) + +{ : prepend : string-stream } diff --git a/main.fnl b/main.fnl @@ -6,6 +6,7 @@ (local textile (require :textile)) (local site (require :site)) (local { : to-html } (require :html)) +(local { : string-stream : prepend } (require :lib)) (local { : view &as fennel } (require :fennel))