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

class ToElement a where Source #

Things that can be converted to SVG elements.

Minimal complete definition

toElement

Methods

toElement :: a -> Element Source #

class Term result where Source #

Used to make specific SVG element builders.

Minimal complete definition

term

Methods

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

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

Instances

Term Element Source # 

Methods

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

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

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.