Popularity
3.4
Declining
Activity
0.0
Stable
4
3
1

Monthly Downloads: 9
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Text     Hastache    

hastache-aeson alternatives and similar packages

Based on the "hastache" category.
Alternatively, view hastache-aeson alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of hastache-aeson or a related project?

Add another 'hastache' Package

README

hastache-aeson

Build Status

  • Lets you pass aeson Value as MuContext to hastache
  • Since yaml is API-compatible to aeson, you can also render yaml Values.

Example

{-# LANGUAGE OverloadedStrings #-}

import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as LBS

import Control.Monad
import Data.Maybe (fromJust)

import Data.Yaml
import Text.Hastache
import Text.Hastache.Aeson (jsonValueContext)

event = BS.readFile "event.yaml"
template = BS.readFile "index.mustache"

render template value = hastacheStr defaultConfig template (jsonValueContext value)

main = do
    value <- liftM (fromJust . decode) event :: IO Value
    template' <- template
    render template' value >>= LBS.putStrLn

Contributors

  • Viktar Basharymau
  • Vladimir Kirillov