Render text. Functions like these can be used to supply content in HTML.
Moduleblaze-html-0.9.2.0Haskell98
Text.Blaze.Html
- 5 types
- 2 classes
- 29 values
- Packageblaze-html-0.9.2.0
- Exports37
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceInternal.hs
Type for an attribute.
The type for the value part of an attribute.
Instances4IsString, Semigroup, Monoid, ToValue
IsString AttributeValueDefined in blaze-markup-0.8.3.0 · Text.Blaze.InternalSemigroup AttributeValueDefined in blaze-markup-0.8.3.0 · Text.Blaze.InternalMonoid AttributeValueDefined in blaze-markup-0.8.3.0 · Text.Blaze.InternalToValue AttributeValueDefined in blaze-markup-0.8.3.0 · Text.Blaze
Simplification of the MarkupM datatype.
Class allowing us to use a single function for Markup values
Methods
toMarkup :: a -> MarkupConvert a value to Markup.
preEscapedToMarkup :: a -> MarkupConvert a value to Markup without escaping
Instances19ToMarkup, …
ToMarkup MarkupDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup IntegerDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup NaturalDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup StringDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup Int32Defined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup Int64Defined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup Word32Defined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup Word64Defined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup BoolDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup CharDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup DoubleDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup FloatDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup IntDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup WordDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup TextDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup BuilderDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup TextDefined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup (NonEmpty Char)Defined in blaze-markup-0.8.3.0 · Text.BlazeToMarkup [Markup]Defined in blaze-markup-0.8.3.0 · Text.Blaze
Apply an attribute to an element.
Example:
img ! src "foo.png"Result:
<img src="foo.png" />This can be used on nested elements as well.
Example:
p ! style "float: right" $ "Hello!"Result:
<p style="float: right">Hello!</p>Shorthand for setting an attribute depending on a conditional.
Example:
p !? (isBig, A.class "big") $ "Hello"Gives the same result as:
(if isBig then p ! A.class "big" else p) "Hello"Type for an HTML tag. This can be seen as an internal string type used by BlazeMarkup.
Take only the text content of an HTML tree.
contents $ do
p ! $ "Hello "
p ! $ "Word!"Result:
Hello World!customAttribute :: TagName of the attribute
-> AttributeValueValue for the attribute
-> AttributeResulting HTML attribtue
Create a custom attribute. This is not specified in the HTML spec, but some JavaScript libraries rely on it.
An example:
<select dojoType="select">foo</select>Can be produced using:
select ! customAttribute "dojoType" "select" $ "foo"dataAttribute :: TagName of the attribute.
-> AttributeValueValue for the attribute.
-> AttributeResulting HTML attribute.
From HTML 5 onwards, the user is able to specify custom data attributes.
An example:
<p data-foo="bar">Hello.</p>We support this in BlazeMarkup using this function. The above fragment could be described using BlazeMarkup with:
p ! dataAttribute "foo" "bar" $ "Hello."Create a comment from a Text value.
The text should not contain "--".
This is not checked by the library.
A variant of preEscapedText for lazy Text
A variant of preEscapedTextValue for lazy Text
Create an HTML snippet from a String without escaping
Create an attribute value from a String without escaping.
Render text without escaping.
Render an attribute value from Text without escaping.
Create an HTML snippet from a String.
Create a comment from a String value.
The text should not contain "--".
This is not checked by the library.
Create an attribute value from a String.
Create a comment from a Text value.
The text should not contain "--".
This is not checked by the library.
Render an attribute value from Text.
Insert a ByteString. This is an unsafe operation:
The ByteString could have the wrong encoding.
The ByteString might contain illegal HTML characters (no escaping is done).
Create a comment from a ByteString value.
The text should not contain "--".
This is not checked by the library.
Create an attribute value from a ByteString. See unsafeByteString for reasons why this might not be a good idea.
Insert a lazy ByteString. See unsafeByteString for reasons why this is an unsafe operation.
Create a comment from a ByteString value.
The text should not contain "--".
This is not checked by the library.
unsafeLazyByteStringValue :: ByteStringByteString value
-> AttributeValueResulting attribute value
Create an attribute value from a lazy ByteString. See unsafeByteString for reasons why this might not be a good idea.
Class allowing us to use a single function for attribute values
Methods
toValue :: a -> AttributeValueConvert a value to an attribute value
preEscapedToValue :: a -> AttributeValueConvert a value to an attribute value without escaping
Instances17ToValue, …
ToValue AttributeValueDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue IntegerDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue StringDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue Int32Defined in blaze-markup-0.8.3.0 · Text.BlazeToValue Int64Defined in blaze-markup-0.8.3.0 · Text.BlazeToValue Word32Defined in blaze-markup-0.8.3.0 · Text.BlazeToValue Word64Defined in blaze-markup-0.8.3.0 · Text.BlazeToValue BoolDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue CharDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue DoubleDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue FloatDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue IntDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue WordDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue TextDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue BuilderDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue TextDefined in blaze-markup-0.8.3.0 · Text.BlazeToValue (NonEmpty Char)Defined in blaze-markup-0.8.3.0 · Text.Blaze