heist 0.11.0 → 0.11.0.1
raw patch · 3 files changed
+21/−19 lines, 3 filesdep ~errorsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: errors
API changes (from Hackage documentation)
Files
- heist.cabal +2/−2
- src/Heist/Compiled/Internal.hs +15/−13
- test/heist-testsuite.cabal +4/−4
heist.cabal view
@@ -1,5 +1,5 @@ name: heist-version: 0.11.0+version: 0.11.0.1 synopsis: An Haskell template system supporting both HTML5 and XML. description: Heist is a powerful template system that supports both HTML5 and XML.@@ -147,7 +147,7 @@ directory >= 1.1 && < 1.3, directory-tree >= 0.10 && < 0.12, dlist >= 0.5 && < 0.6,- errors >= 1.3 && < 1.4,+ errors >= 1.4 && < 1.5, filepath >= 1.3 && < 1.4, hashable >= 1.1 && < 1.3, mtl >= 2.0 && < 2.2,
src/Heist/Compiled/Internal.hs view
@@ -11,6 +11,7 @@ ------------------------------------------------------------------------------ import Blaze.ByteString.Builder+import Blaze.ByteString.Builder.Char8 import Control.Arrow import Control.Monad import Control.Monad.RWS.Strict@@ -122,8 +123,7 @@ => [(Text, a -> Text)] -> Promise a -> HeistT n IO (RuntimeSplice n Builder)-promiseChildrenWithText =- promiseChildrenWithTrans (fromByteString . T.encodeUtf8)+promiseChildrenWithText = promiseChildrenWithTrans fromText ------------------------------------------------------------------------------@@ -181,7 +181,7 @@ ------------------------------------------------------------------------------ -- | Convenience wrapper around yieldRuntime allowing you to work with Text. yieldRuntimeText :: Monad m => RuntimeSplice m Text -> DList (Chunk m)-yieldRuntimeText = yieldRuntime . liftM (fromByteString . T.encodeUtf8)+yieldRuntimeText = yieldRuntime . liftM fromText {-# INLINE yieldRuntimeText #-} @@ -461,15 +461,15 @@ attrToBuilder :: (Text, Text) -> Builder attrToBuilder (k,v) | T.null v = mconcat- [ fromByteString $! T.encodeUtf8 " "- , fromByteString $! T.encodeUtf8 k+ [ fromText " "+ , fromText k ] | otherwise = mconcat- [ fromByteString $! T.encodeUtf8 " "- , fromByteString $! T.encodeUtf8 k- , fromByteString $! T.encodeUtf8 "=\""- , fromByteString $! T.encodeUtf8 v- , fromByteString $! T.encodeUtf8 "\""+ [ fromText " "+ , fromText k+ , fromText "=\""+ , fromText v+ , fromText "\"" ] @@ -641,8 +641,10 @@ -> HeistT n IO (DList (Chunk n)) callTemplate nm = do hs <- getHS- return $ maybe DL.empty (DL.fromList . fst . fst) $- lookupTemplate nm hs _compiledTemplateMap+ runNodeList $ maybe (error err) (X.docContent . dfDoc . fst) $+ lookupTemplate nm hs _templateMap+ where+ err = "callTemplate: "++(T.unpack $ T.decodeUtf8 nm)++(" does not exist") interpret :: Monad m => DList (Chunk m) -> m Builder@@ -664,7 +666,7 @@ textSplices = mapSnd textSplice textSplice :: (a -> Text) -> a -> Builder-textSplice f = fromByteString . T.encodeUtf8 . f+textSplice f = fromText . f nodeSplices :: [(Text, a -> [X.Node])] -> [(Text, a -> Builder)] nodeSplices = mapSnd nodeSplice
test/heist-testsuite.cabal view
@@ -24,9 +24,9 @@ directory >= 1.1 && < 1.3, directory-tree >= 0.10 && < 0.12, dlist >= 0.5 && < 0.6,- errors >= 1.3 && < 1.4,+ errors >= 1.4 && < 1.5, filepath >= 1.3 && < 1.4,- hashable >= 1.1 && < 1.2,+ hashable >= 1.1 && < 1.3, mtl >= 2.0 && < 2.2, process >= 1.1 && < 1.2, random >= 1.0.1.0 && < 1.1,@@ -64,9 +64,9 @@ directory >= 1.1 && < 1.3, directory-tree >= 0.10 && < 0.12, dlist >= 0.5 && < 0.6,- errors >= 1.3 && < 1.4,+ errors >= 1.4 && < 1.5, filepath >= 1.3 && < 1.4,- hashable >= 1.1 && < 1.2,+ hashable >= 1.1 && < 1.3, mtl >= 2.0 && < 2.2, process >= 1.1 && < 1.2, random >= 1.0.1.0 && < 1.1,