HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleblaze-svg-0.3.7Haskell2010

Text.Blaze.Svg11

This module exports SVG combinators used to create documents.

  • 4 types
  • 2 classes
  • 109 values
  • Packageblaze-svg-0.3.7
  • Exports116
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSvg11.hs
valuetext
  1. :: Text

    Text to render.

  2. -> Markup

    Resulting HTML fragment.

#

Render text. Functions like these can be used to supply content in HTML.

newtypenewtype Attribute
#

Type for an attribute.

Instances2Semigroup, Monoid
classclass ToMarkup a where
#

Class allowing us to use a single function for Markup values

Methods

Instances19ToMarkup, …
classclass ToValue a where
#

Class allowing us to use a single function for attribute values

Methods

Instances17ToValue, …
method(!) :: h -> Attribute -> h
#

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>
value(!?) :: Attributable h => h -> (Bool, Attribute) -> h
#

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"
newtypenewtype Tag
#

Type for an HTML tag. This can be seen as an internal string type used by BlazeMarkup.

Instances1IsString
  • IsString TagDefined in blaze-markup-0.8.3.0 · Text.Blaze.Internal
valuecontents :: MarkupM a -> MarkupM a
#

Take only the text content of an HTML tree.

contents $ do
    p ! $ "Hello "
    p ! $ "Word!"

Result:

Hello World!
valuecustomAttribute
  1. :: Tag

    Name of the attribute

  2. -> AttributeValue

    Value for the attribute

  3. -> Attribute

    Resulting 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"
valuedataAttribute
  1. :: Tag

    Name of the attribute.

  2. -> AttributeValue

    Value for the attribute.

  3. -> Attribute

    Resulting 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."
valuetextComment :: Text -> Markup
#

Create a comment from a Text value. The text should not contain "--". This is not checked by the library.

valuedocType
  1. :: Svg

    The document type SVG.

#

Combinator for the document type. This should be placed at the top of every SVG page.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
valuedocTypeSvg
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <svg> element. This combinator will also insert the correct doctype.

valuea
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <a> element.

valuealtglyph
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <altGlyph> element.

valuealtglyphdef
  1. :: Svg

    Resulting SVG.

#

Combinator for the <altGlyphDef /> element.

valuealtglyphitem
  1. :: Svg

    Resulting SVG.

#

Combinator for the <altGlyphItem /> element.

valueanimate
  1. :: Svg

    Resulting SVG.

#

Combinator for the <animate /> element.

valueanimatecolor
  1. :: Svg

    Resulting SVG.

#

Combinator for the <animateColor /> element.

valueanimatemotion
  1. :: Svg

    Resulting SVG.

#

Combinator for the <animateMotion /> element.

valuecircle
  1. :: Svg

    Resulting SVG.

#

Combinator for the <circle /> element.

valueclippath
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <clipPath> element.

valuecolorProfile
  1. :: Svg

    Resulting SVG.

#

Combinator for the <color-profile /> element.

valuecursor
  1. :: Svg

    Resulting SVG.

#

Combinator for the <cursor /> element.

valuedefs
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <defs> element.

valuedesc
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <desc> element.

valueellipse
  1. :: Svg

    Resulting SVG.

#

Combinator for the <ellipse /> element.

valuefeblend
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feBlend /> element.

valuefecolormatrix
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feColorMatrix /> element.

valuefecomposite
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feComposite /> element.

valuefedistantlight
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feDistantLight /> element.

valuefeflood
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feFlood /> element.

valuefefunca
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feFuncA /> element.

valuefefuncb
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feFuncB /> element.

valuefefuncg
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feFuncG /> element.

valuefefuncr
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feFuncR /> element.

valuefegaussianblur
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feGaussianBlur /> element.

valuefeimage
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feImage /> element.

valuefemerge
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feMerge /> element.

valuefemergenode
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feMergeNode /> element.

valuefemorphology
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feMorphology /> element.

valuefeoffset
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feOffset /> element.

valuefepointlight
  1. :: Svg

    Resulting SVG.

#

Combinator for the <fePointLight /> element.

valuefespotlight
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feSpotLight /> element.

valuefetile
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feTile /> element.

valuefeturbulence
  1. :: Svg

    Resulting SVG.

#

Combinator for the <feTurbulence /> element.

valuefilter_
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <filter> element.

valuefont
  1. :: Svg

    Resulting SVG.

#

Combinator for the <font /> element.

valuefontFace
  1. :: Svg

    Resulting SVG.

#

Combinator for the <font-face /> element.

valuefontFaceFormat
  1. :: Svg

    Resulting SVG.

#

Combinator for the <font-face-format /> element.

valuefontFaceName
  1. :: Svg

    Resulting SVG.

#

Combinator for the <font-face-name /> element.

valuefontFaceSrc
  1. :: Svg

    Resulting SVG.

#

Combinator for the <font-face-src /> element.

valuefontFaceUri
  1. :: Svg

    Resulting SVG.

#

Combinator for the <font-face-uri /> element.

valueforeignobject
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <foreignObject> element.

valueg
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <g> element.

valueglyph
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <glyph> element.

valueglyphref
  1. :: Svg

    Resulting SVG.

#

Combinator for the <glyphRef /> element.

valuehkern
  1. :: Svg

    Resulting SVG.

#

Combinator for the <hkern /> element.

valueimage
  1. :: Svg

    Resulting SVG.

#

Combinator for the <image /> element.

valueline
  1. :: Svg

    Resulting SVG.

#

Combinator for the <line /> element.

valuelineargradient
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <linearGradient> element.

valuemarker
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <marker> element.

valuemask
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <mask> element.

valuemetadata
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <metadata> element.

valuemissingGlyph
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <missing-glyph> element.

valuempath
  1. :: Svg

    Resulting SVG.

#

Combinator for the <mpath /> element.

valuepath
  1. :: Svg

    Resulting SVG.

#

Combinator for the <path /> element.

valuepattern
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <pattern> element.

valuepolygon
  1. :: Svg

    Resulting SVG.

#

Combinator for the <polygon /> element.

valuepolyline
  1. :: Svg

    Resulting SVG.

#

Combinator for the <polyline /> element.

valueradialgradient
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <radialGradient> element.

valuerect
  1. :: Svg

    Resulting SVG.

#

Combinator for the <rect /> element.

valuescript
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <script> element.

valueset
  1. :: Svg

    Resulting SVG.

#

Combinator for the <set /> element.

valuestop
  1. :: Svg

    Resulting SVG.

#

Combinator for the <stop /> element.

valuestyle
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <style> element.

valuesvg
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <svg> element.

valueswitch
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <switch> element.

valuesymbol
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <symbol> element.

valuetext_
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <text> element.

valuetextpath
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <textPath> element.

valuetitle
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <title> element.

valuetref
  1. :: Svg

    Resulting SVG.

#

Combinator for the <tref /> element.

valuetspan
  1. :: Svg

    Inner SVG.

  2. -> Svg

    Resulting SVG.

#

Combinator for the <tspan> element.

valueuse
  1. :: Svg

    Resulting SVG.

#

Combinator for the <use /> element.

valueview
  1. :: Svg

    Resulting SVG.

#

Combinator for the <view /> element.

valuevkern
  1. :: Svg

    Resulting SVG.

#

Combinator for the <vkern /> element.