packages feed

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

module Network.Orchid.Core.Format where

import Data.ByteString.Lazy (ByteString)

import Network.Protocol.Uri (URI)
import Network.Orchid.Core.Backend

-- Formats produce proper UTF-8 text or binary docs. (TODO: ascii for tex?)
data Output =
    TextOutput   String
  | BinaryOutput ByteString

-- Wiki format description data type.
data WikiFormat =
  WikiFormat {
    extension :: String
  , mime      :: String
  , handler   :: Backend -> FilePath -> URI -> String -> IO Output
  }