svg-builder-0.1.0.2: 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.

data Element #

Type of an SVG element.

Instances

class ToElement a where #

Things that can be converted to SVG elements.

Minimal complete definition

toElement

Methods

toElement :: a -> Element #

class Term result where #

Used to make specific SVG element builders.

Minimal complete definition

term

Methods

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

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

Instances

Term Element # 

Methods

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

(~) * e Element => Term (e -> Element) # 

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.