svg-tree-0.1: SVG file loader and serializer

Safe HaskellNone

Graphics.Svg

Contents

Description

Module providing basic input/output for the SVG document, for document building, please refer to Graphics.Svg.Types.

Synopsis

Saving/Loading functions

loadSvgFile :: FilePath -> IO (Maybe Document)Source

Try to load an svg file on disc and parse it as a SVG Document.

parseSvgFileSource

Arguments

:: FilePath

Source path/URL of the document, used to resolve relative links.

-> ByteString 
-> Maybe Document 

Parse an in-memory SVG file

xmlOfDocument :: Document -> ElementSource

Transform a SVG document to a XML node.

saveXmlFile :: FilePath -> Document -> IO ()Source

Save a svg Document on a file on disk.

Manipulation functions

cssApply :: [CssRule] -> Tree -> TreeSource

Rewrite a SVG Tree using some CSS rules.

This action will propagate the definition of the css directly in each matched element.

cssRulesOfText :: Text -> [CssRule]Source

Parse CSS text into rules.

applyCSSRules :: Document -> DocumentSource

Rewrite the document by applying the CSS rules embedded inside it.

resolveUses :: Document -> DocumentSource

For every use tag, try to resolve the geometry associated with it and place it in the scene Tree. It is important to resolve the use tag before applying the CSS rules, as some rules may apply some elements matching the children of use.

Type definitions