lucid 0.1 → 0.2
raw patch · 2 files changed
+12/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Lucid.Base: instance ToHtml Int
+ Lucid.Base: renderToFile :: FilePath -> Html a -> IO ()
Files
- lucid.cabal +1/−1
- src/Lucid/Base.hs +11/−4
lucid.cabal view
@@ -1,5 +1,5 @@ name: lucid-version: 0.1+version: 0.2 synopsis: Clear to write, read and edit DSL for HTML description: Clear to write, read and edit DSL for HTML. See the 'Lucid' module for description and documentation.
src/Lucid/Base.hs view
@@ -12,6 +12,7 @@ ,renderBS ,renderTextT ,renderBST+ ,renderToFile -- * Running ,execHtmlT ,evalHtmlT@@ -38,6 +39,7 @@ import Control.Monad import Control.Monad.Reader import Data.ByteString.Lazy (ByteString)+import qualified Data.ByteString.Lazy as L import Data.Functor.Identity import Data.Monoid import Data.String@@ -143,10 +145,6 @@ toHtml = fromString toHtmlRaw m = HtmlT (return ((\_ _ -> Blaze.fromString m),())) -instance ToHtml Int where- toHtml i = HtmlT (return ((\_ _ -> Blaze.fromInthost i),()))- toHtmlRaw = toHtml- instance ToHtml Text where toHtml m = HtmlT (return ((\_ _ -> encode m),())) toHtmlRaw m = HtmlT (return ((\_ _ -> Blaze.fromText m),()))@@ -207,6 +205,15 @@ -------------------------------------------------------------------------------- -- Running++-- | Render the HTML to a lazy 'ByteString'.+--+-- This is a convenience function defined in terms of 'execHtmlT',+-- 'runIdentity' and 'Blaze.toLazyByteString'. Check the source if+-- you're interested in the lower-level behaviour.+--+renderToFile :: FilePath -> Html a -> IO ()+renderToFile fp = L.writeFile fp . Blaze.toLazyByteString . runIdentity . execHtmlT -- | Render the HTML to a lazy 'ByteString'. --