svg-builder-0.1.1: DSL for building SVG.

Copyright(c) 2015 Jeffrey Rosenbluth
LicenseBSD-style (see LICENSE)
Maintainerjeffrey.rosenbluth@gmail.com
Safe HaskellNone
LanguageHaskell2010

Graphics.Svg.Core

Contents

Description

svg-builder Core types and functions.

Synopsis

Types

data Attribute #

Attribute name value.

Instances
Eq Attribute # 
Instance details

Defined in Graphics.Svg.Core

Show Attribute # 
Instance details

Defined in Graphics.Svg.Core

Hashable Attribute # 
Instance details

Defined in Graphics.Svg.Core

data Element #

Type of an SVG element.

Instances
Show Element # 
Instance details

Defined in Graphics.Svg.Core

IsString Element # 
Instance details

Defined in Graphics.Svg.Core

Methods

fromString :: String -> Element #

Semigroup Element # 
Instance details

Defined in Graphics.Svg.Core

Monoid Element # 
Instance details

Defined in Graphics.Svg.Core

Term Element # 
Instance details

Defined in Graphics.Svg.Core

Methods

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

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

Defined in Graphics.Svg.Core

Methods

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

class ToElement a where #

Things that can be converted to SVG elements.

Methods

toElement :: a -> Element #

Instances
ToElement String # 
Instance details

Defined in Graphics.Svg.Core

Methods

toElement :: String -> Element #

ToElement Text # 
Instance details

Defined in Graphics.Svg.Core

Methods

toElement :: Text -> Element #

ToElement Text # 
Instance details

Defined in Graphics.Svg.Core

Methods

toElement :: Text -> Element #

class Term result where #

Used to make specific SVG element builders.

Methods

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

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

Instances
Term Element # 
Instance details

Defined in Graphics.Svg.Core

Methods

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

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

Defined in Graphics.Svg.Core

Methods

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

Combinators

makeAttribute #

Arguments

:: Text

Attribute name.

-> Text

Attribute value.

-> Attribute 

Make an attribute.

makeElement :: Text -> Element -> Element #

Make an SVG element builder

makeElementNoEnd :: Text -> Element #

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

makeElementDoctype :: Text -> Element #

Make an SVG doctype element builder.

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

Add a list of attributes to an element

Rendering

renderBS :: Element -> ByteString #

Render a Element to lazy bytestring.

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

Render a Element to a file.

renderText :: Element -> Text #

Reder an Element to lazy text.