rib-0.8.0.0: Static site generator using Shake

Safe HaskellNone
LanguageHaskell2010

Rib.Parser.MMark

Contents

Description

Parsing Markdown using the mmark parser.

Synopsis

Parsing

parse :: Path Rel File -> Action MMark Source #

Parse Markdown using mmark

parsePure Source #

Arguments

:: FilePath

Filepath corresponding to the text to be parsed (used only in parse errors)

-> Text

Text to be parsed

-> Either Text MMark 

Pure version of parse

parseWith :: [Extension] -> Path Rel File -> Action MMark Source #

Like parse but takes a custom list of MMark extensions

parsePureWith Source #

Arguments

:: [Extension] 
-> FilePath

Filepath corresponding to the text to be parsed (used only in parse errors)

-> Text

Text to be parsed

-> Either Text MMark 

Like parsePure but takes a custom list of MMark extensions

Rendering

render :: Monad m => MMark -> HtmlT m () Source #

Render a MMark document as HTML

Extracting information

getFirstImg :: MMark -> Maybe URI Source #

Get the first image in the document if one exists

getFirstParagraphText :: MMark -> Maybe Text Source #

Get the first paragraph text of a MMark document.

Useful to determine "preview" of your notes.

projectYaml :: MMark -> Maybe Value #

Extract contents of an optional YAML block that may have been parsed.

Re-exports

data MMark #

Representation of complete markdown document. You can't look inside of MMark on purpose. The only way to influence an MMark document you obtain as a result of parsing is via the extension mechanism.

Instances
Show MMark

Dummy instance.

Since: mmark-0.0.5.0

Instance details

Defined in Text.MMark.Type

Methods

showsPrec :: Int -> MMark -> ShowS #

show :: MMark -> String #

showList :: [MMark] -> ShowS #

NFData MMark 
Instance details

Defined in Text.MMark.Type

Methods

rnf :: MMark -> () #