seonbi-0.5.0: SmartyPants for Korean language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Seonbi.ContentTypes

Synopsis

Documentation

type ContentType = MediaType Source #

Represents a case-insensitive content type.

type HtmlTransformer m = (Monad m, MonadFail m) => [HtmlEntity] -> m [HtmlEntity] Source #

Represents a function that transforms an HtmlEntity list.

type TextTransformer m = (Monad m, MonadFail m) => Text -> m Text Source #

Represents a function that transforms a text.

asCommonMarkTransformer :: (Monad m, MonadFail m) => TransformerTransformer m Source #

Transforms an HtmlTransformer into a TextTransformer which transforms a CommonMark (Markdown) text.

asHtmlTransformer :: (Monad m, MonadFail m) => TransformerTransformer m Source #

Transforms an HtmlTransformer into a TextTransformer which transforms an HTML text.

asHtmlTransformer' Source #

Arguments

:: (Monad m, MonadFail m) 
=> Bool

True for XHTML, and False for HTML.

-> TransformerTransformer m

A TransformerTransformer that transforms an HtmlTransformer into a TextTransformer which transforms an HTML/XHTML text.

Gets a TransformerTransformer that transforms HtmlTransformer into a TextTransformer which transforms an HTML/XHTML text.

asPlainTextTransformer :: (Monad m, MonadFail m) => TransformerTransformer m Source #

Transforms an HtmlTransformer into a TextTransformer which transforms a plain text.

asXhtmlTransformer :: (Monad m, MonadFail m) => TransformerTransformer m Source #

Transforms an HtmlTransformer into a TextTransformer which transforms an XHTML text.

contentTypes :: Set ContentType Source #

Supported content types.

transformWithContentType Source #

Arguments

:: (Monad m, MonadFail m) 
=> ContentType

A content type. If the content type is unsupported (i.e. not in contentTypes), this function fails.

-> HtmlTransformer m

An HtmlTransformer to apply.

-> Text

A input text to transform.

-> m Text

A transformed text.

Applies an HtmlTransformer to the given text with respect to the given content type.