Safe Haskell | None |
---|---|
Language | Haskell2010 |
A small Markdown eDSL.
Synopsis
- type Markdown = Builder
- newtype HeaderLevel = HeaderLevel Int
- newtype Anchor = Anchor {}
- class ToAnchor anchor where
- nextHeaderLevel :: HeaderLevel -> HeaderLevel
- mdHeader :: HeaderLevel -> Markdown -> Markdown
- mdToc :: ToAnchor anchor => HeaderLevel -> Markdown -> anchor -> Markdown
- mdSubsection :: Markdown -> Markdown -> Markdown
- mdSubsectionTitle :: Markdown -> Markdown
- mdBold :: Markdown -> Markdown
- mdItalic :: Markdown -> Markdown
- mdTicked :: Markdown -> Markdown
- mdRef :: Markdown -> Markdown -> Markdown
- mdLocalRef :: ToAnchor anchor => Markdown -> anchor -> Markdown
- mdEscapeAnchor :: ToAnchor anchor => anchor -> Markdown
- mdAnchor :: ToAnchor anchor => anchor -> Markdown
- mdSeparator :: Markdown
- mdSpoiler :: Markdown -> Markdown -> Markdown
- mdComment :: Builder -> Builder
- md :: QuasiQuoter
Documentation
type Markdown = Builder Source #
A piece of markdown document.
This is opposed to Text
type, which in turn is not supposed to contain
markup elements.
Anchor with given text.
class ToAnchor anchor where Source #
Picking anchor for various things.
mdSubsectionTitle :: Markdown -> Markdown Source #
mdEscapeAnchor :: ToAnchor anchor => anchor -> Markdown Source #
Turn text into valid anchor. Human-readability is not preserved.
md :: QuasiQuoter Source #
Quasi quoter for Markdown.
This supports interpolation via #{expression}
syntax.