2015-07-30 01:29:28 +00:00
|
|
|
module Within.DBMemorial.Utils where
|
|
|
|
|
2015-07-30 05:33:14 +00:00
|
|
|
import Data.Text (Text)
|
|
|
|
import qualified Data.Text as Text
|
|
|
|
import Data.Text.Lazy (toStrict)
|
|
|
|
import Text.Blaze.Html (Html)
|
|
|
|
import Text.Blaze.Renderer.Text
|
|
|
|
import qualified Within.DBMemorial.Views.Materialize as Materialize
|
|
|
|
|
2015-07-30 01:29:28 +00:00
|
|
|
-- https://hackage.haskell.org/package/base-4.8.0.0/docs/src/Data-Function.html#%26
|
|
|
|
(&) :: a -> (a -> b) -> b
|
|
|
|
x & f = f x
|
2015-07-30 05:33:14 +00:00
|
|
|
|
|
|
|
wrapMarkup :: Text -> Html -> Text
|
|
|
|
wrapMarkup title body =
|
|
|
|
toStrict $ renderMarkup $ Materialize.render title body
|
|
|
|
|
|
|
|
wrapMarkupStringTitle :: String -> Html -> Text
|
|
|
|
wrapMarkupStringTitle title body =
|
|
|
|
wrapMarkup (Text.pack title) body
|