packages feed

orchid-0.0.6: src/Network/Orchid/Format/Html.hs

module Network.Orchid.Format.Html (fHtml) where

import Control.Monad (liftM)

import Text.Document.Document
import Network.Orchid.Core.Backend
import Network.Orchid.Core.Format
import Network.Protocol.Uri

fHtml = WikiFormat "html" "text/html" html

html :: Backend -> FilePath -> URI -> String -> IO Output
html _ work _ src = do
  case fromWiki src of
    Left err  -> return $ TextOutput (show err)
    Right doc -> liftM (TextOutput . show) (processToXHTML work doc)