18 lines
473 B
Haskell
18 lines
473 B
Haskell
module Page (
|
|
Page(..)
|
|
, at
|
|
) where
|
|
|
|
import Markdown (Markdown(..), MarkdownContent(..))
|
|
import qualified Markdown as Markdown (at)
|
|
import Text.ParserCombinators.Parsec (ParseError)
|
|
|
|
newtype Page = Page Markdown
|
|
instance MarkdownContent Page where
|
|
getMarkdown (Page markdown) = markdown
|
|
|
|
at :: FilePath -> IO (Either ParseError (String, Page))
|
|
at filePath = fmap makePage <$> Markdown.at filePath
|
|
where
|
|
makePage markdown = (key markdown, Page markdown)
|