Try using pandoc?
This commit is contained in:
parent
e255e6672e
commit
99567b586b
|
@ -8,6 +8,7 @@ import Database.SQLite.Simple.FromRow
|
|||
import Text.Blaze.Html5 ((!))
|
||||
import qualified Text.Blaze.Html5 as H
|
||||
import qualified Text.Blaze.Html5.Attributes as A
|
||||
import Text.Pandoc
|
||||
|
||||
data Post = Post
|
||||
{ id :: Int
|
||||
|
@ -26,4 +27,9 @@ render post = do
|
|||
H.div ! A.class_ "card blue-grey darken-1" $ do
|
||||
H.div ! A.class_ "card-content white-text" $ do
|
||||
H.span ! A.class_ "card-title" $ H.toHtml $ unpack (author post)
|
||||
H.p $ H.toHtml $ unpack (markdown post)
|
||||
|
||||
state <- case readTextile def (unpack $ body post) of
|
||||
Right v -> return v
|
||||
Left err -> error (show err)
|
||||
|
||||
H.p $ writeHtml def state
|
||||
|
|
|
@ -65,6 +65,8 @@ executable time-wasting-thread-memorial
|
|||
, blaze-markup >=0.7.0.2
|
||||
, wai-middleware-static >=0.7.0.1
|
||||
, wai-extra >=1.3.0
|
||||
, pandoc >=1.15.0.6
|
||||
, mtl >=2.2.1
|
||||
|
||||
-- Directories containing source files.
|
||||
hs-source-dirs: src
|
||||
|
|
Loading…
Reference in New Issue