Permalink
Browse files

Added simplest example

  • Loading branch information...
1 parent 3f749e9 commit f0e6e0e010a5e003d22b088ad73a7bd443b246b6 @lymar lymar committed Nov 8, 2011
Showing with 24 additions and 0 deletions.
  1. +24 −0 Text/Hastache.hs
View
@@ -12,6 +12,30 @@
{- | Haskell implementation of Mustache templates
See homepage for examples of usage: <http://github.com/lymar/hastache>
+
+Simplest example:
+
+@
+module Main where
+
+import Text.Hastache
+import Text.Hastache.Context
+import qualified Data.ByteString.Lazy as LZ
+
+main = do
+ res <- hastacheStr defaultConfig (encodeStr template)
+ (mkStrContext context)
+ LZ.putStrLn res
+ where
+ template = \"Hello, {{name}}!\"
+ context \"name\" = MuVariable \"Haskell\"
+@
+
+Result:
+
+@
+Hello, Haskell!
+@
-}
module Text.Hastache (
hastacheStr

0 comments on commit f0e6e0e

Please sign in to comment.