Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type ContentType = MediaType
- type HtmlTransformer m = (Monad m, MonadFail m) => [HtmlEntity] -> m [HtmlEntity]
- type TextTransformer m = (Monad m, MonadFail m) => Text -> m Text
- asCommonMarkTransformer :: (Monad m, MonadFail m) => TransformerTransformer m
- asHtmlTransformer :: (Monad m, MonadFail m) => TransformerTransformer m
- asHtmlTransformer' :: (Monad m, MonadFail m) => Bool -> TransformerTransformer m
- asPlainTextTransformer :: (Monad m, MonadFail m) => TransformerTransformer m
- asXhtmlTransformer :: (Monad m, MonadFail m) => TransformerTransformer m
- contentTypeFromText :: Text -> Maybe ContentType
- contentTypes :: Set ContentType
- contentTypeText :: ContentType -> Text
- transformWithContentType :: (Monad m, MonadFail m) => ContentType -> HtmlTransformer m -> Text -> m Text
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.
:: (Monad m, MonadFail m) | |
=> Bool | |
-> TransformerTransformer m | A |
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.
contentTypeFromText :: Text -> Maybe ContentType Source #
Converts a Text
to a ContentType
.
contentTypes :: Set ContentType Source #
Supported content types.
contentTypeText :: ContentType -> Text Source #
Converts a ContentType
to a Text
.
transformWithContentType Source #
:: (Monad m, MonadFail m) | |
=> ContentType | A content type. If the content type is unsupported (i.e. not in
|
-> HtmlTransformer m | An |
-> 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.