hablo/src/Page.hs

18 lines
400 B
Haskell

module Page (
Page(..)
, at
) where
import Markdown (Markdown(..))
import qualified Markdown as Markdown (at)
import Text.ParserCombinators.Parsec (ParseError)
newtype Page = Page {
getMarkdown :: Markdown
}
at :: FilePath -> IO (Either ParseError (String, Page))
at filePath = fmap makePage <$> Markdown.at filePath
where
makePage markdown = (key markdown, Page markdown)