Copyright | (c) 2021-2022 Mirko Westermeier |
---|---|
License | MIT |
Safe Haskell | None |
Language | Haskell2010 |
Loading HTMell content from markdown files
Synopsis
- data MarkdownContent = MarkdownContent {}
- readMarkdown :: String -> MarkdownContent
- loadMarkdownContent :: FilePath -> IO (Maybe MarkdownContent)
What is markdown content?
data MarkdownContent #
A markdown content value consists of metadata and markdown data. The
metadata
is read as HTMell.Content.Metadata.Frontmatter, the
markdown is just the source after the frontmatter data and will be
translated to HTML via CMark when calling toHTML
.
Instances
Eq MarkdownContent # | |
Defined in HTMell.Content.Markdown (==) :: MarkdownContent -> MarkdownContent -> Bool # (/=) :: MarkdownContent -> MarkdownContent -> Bool # | |
Show MarkdownContent # | |
Defined in HTMell.Content.Markdown showsPrec :: Int -> MarkdownContent -> ShowS # show :: MarkdownContent -> String # showList :: [MarkdownContent] -> ShowS # | |
HTMellContent MarkdownContent # | |
Defined in HTMell.Content.Markdown getContent :: FilePath -> IO (Maybe MarkdownContent) # metadata :: MarkdownContent -> Map String String # toHTML :: MarkdownContent -> Text # |
Obtaining markdown content
readMarkdown :: String -> MarkdownContent #
Build a MarkdownContent
value from a source String
.
loadMarkdownContent :: FilePath -> IO (Maybe MarkdownContent) #
Read a MarkdownContent
value from a file.