This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "heist".
The branch, master has been updated
via feef2878249a5925501aff397c9448b42b3f3fd3 (commit)
from 5a0e4e3bd908920da10a415cf2e949cd4af5a912 (commit)
Summary of changes:
src/Text/Templating/Heist.hs | 2 ++
src/Text/Templating/Heist/Internal.hs | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit feef2878249a5925501aff397c9448b42b3f3fd3
Author: Mighty Byte <[email protected]>
Date: Thu Mar 24 11:29:09 2011 -0400
Added textSplice.
diff --git a/src/Text/Templating/Heist.hs b/src/Text/Templating/Heist.hs
index 34da534..95e0531 100644
--- a/src/Text/Templating/Heist.hs
+++ b/src/Text/Templating/Heist.hs
@@ -114,6 +114,8 @@ module Text.Templating.Heist
, bindStrings
, bindString
+ -- * Functions for creating splices
+ , textSplice
, runChildren
, runChildrenWith
, runChildrenWithTrans
diff --git a/src/Text/Templating/Heist/Internal.hs
b/src/Text/Templating/Heist/Internal.hs
index bc64006..b4cd56b 100644
--- a/src/Text/Templating/Heist/Internal.hs
+++ b/src/Text/Templating/Heist/Internal.hs
@@ -94,6 +94,12 @@ bindSplices ss ts = foldl' (flip id) ts acts
------------------------------------------------------------------------------
+-- | Converts 'Text' to a splice returning a single 'TextNode'.
+textSplice :: (Monad m) => Text -> Splice m
+textSplice = return . (:[]) . X.TextNode
+
+
+------------------------------------------------------------------------------
-- | Runs the parameter node's children and returns the resulting node list.
-- By itself this function is a simple passthrough splice that makes the
-- spliced node disappear. In combination with locally bound splices, this
@@ -135,7 +141,7 @@ runChildrenWithTemplates = runChildrenWithTrans return
------------------------------------------------------------------------------
-- | Like runChildrenWith but using literal text rather than dynamic splices.
runChildrenWithText :: (Monad m) => [(Text, Text)] -> Splice m
-runChildrenWithText = runChildrenWithTrans (return . (:[]) . X.TextNode)
+runChildrenWithText = runChildrenWithTrans textSplice
------------------------------------------------------------------------------
-----------------------------------------------------------------------
hooks/post-receive
--
heist
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap