packages feed

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

module Network.Orchid.Format.History (fHistory) where

import Control.Monad (liftM)
import Data.List (intercalate)

import Text.Document.Document
import Network.Orchid.Core.Backend
import Network.Orchid.Core.Format
import qualified Network.Protocol.Uri as U

fHistory = WikiFormat "his" "text/plain" history'

history' :: Backend -> FilePath -> U.URI -> String -> IO Output
history' backend _ f _ = do
  liftM
    (TextOutput . maybe "no history" (intercalate "\n\n" . map show))
    (history backend $ U.path $ U.relative f)