svg-builder-0.1.1: DSL for building SVG.
Copyright(c) 2015 Jeffrey Rosenbluth
LicenseBSD-style (see LICENSE)
Maintainerjeffrey.rosenbluth@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.Svg.Core

Description

svg-builder Core types and functions.

Synopsis

Types

data Attribute Source #

Attribute name value.

Instances

Instances details
Show Attribute Source # 
Instance details

Defined in Graphics.Svg.Core

Eq Attribute Source # 
Instance details

Defined in Graphics.Svg.Core

Hashable Attribute Source # 
Instance details

Defined in Graphics.Svg.Core

data Element Source #

Type of an SVG element.

Instances

Instances details
IsString Element Source # 
Instance details

Defined in Graphics.Svg.Core

Monoid Element Source # 
Instance details

Defined in Graphics.Svg.Core

Semigroup Element Source # 
Instance details

Defined in Graphics.Svg.Core

Show Element Source # 
Instance details

Defined in Graphics.Svg.Core

Term Element Source # 
Instance details

Defined in Graphics.Svg.Core

Methods

term :: Text -> [Attribute] -> Element Source #

e ~ Element => Term (e -> Element) Source # 
Instance details

Defined in Graphics.Svg.Core

Methods

term :: Text -> [Attribute] -> e -> Element Source #

class ToElement a where Source #

Things that can be converted to SVG elements.

Methods

toElement :: a -> Element Source #

Instances

Instances details
ToElement Text Source # 
Instance details

Defined in Graphics.Svg.Core

ToElement Text Source # 
Instance details

Defined in Graphics.Svg.Core

ToElement String Source # 
Instance details

Defined in Graphics.Svg.Core

class Term result where Source #

Used to make specific SVG element builders.

Methods

term :: Text -> [Attribute] -> result Source #

Used for constructing elements e.g. term "circle" yields circle_.

Instances

Instances details
Term Element Source # 
Instance details

Defined in Graphics.Svg.Core

Methods

term :: Text -> [Attribute] -> Element Source #

e ~ Element => Term (e -> Element) Source # 
Instance details

Defined in Graphics.Svg.Core

Methods

term :: Text -> [Attribute] -> e -> Element Source #

Combinators

makeAttribute Source #

Arguments

:: Text

Attribute name.

-> Text

Attribute value.

-> Attribute 

Make an attribute.

makeElement :: Text -> Element -> Element Source #

Make an SVG element builder

makeElementNoEnd :: Text -> Element Source #

Make an SVG element with no end tag, contains only attributes.

makeElementDoctype :: Text -> Element Source #

Make an SVG doctype element builder.

with :: Element -> [Attribute] -> Element Source #

Add a list of attributes to an element

Rendering

renderBS :: Element -> ByteString Source #

Render a Element to lazy bytestring.

renderToFile :: FilePath -> Element -> IO () Source #

Render a Element to a file.

renderText :: Element -> Text Source #

Reder an Element to lazy text.