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)