Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module providing basic input/output for the SVG document, for document building, please refer to Graphics.Svg.Types.
Synopsis
- loadSvgFile :: FilePath -> IO (Maybe Document)
- parseSvgFile :: FilePath -> ByteString -> Maybe Document
- xmlOfDocument :: Document -> Element
- saveXmlFile :: FilePath -> Document -> IO ()
- cssApply :: [CssRule] -> Tree -> Tree
- cssRulesOfText :: Text -> [CssRule]
- applyCSSRules :: Document -> Document
- resolveUses :: Document -> Document
- module Graphics.SvgTree.Types
Saving/Loading functions
loadSvgFile :: FilePath -> IO (Maybe Document) Source #
Try to load an svg file on disc and parse it as a SVG Document.
:: FilePath | Source path/URL of the document, used to resolve relative links. |
-> ByteString | |
-> Maybe Document |
Parse an in-memory SVG file
xmlOfDocument :: Document -> Element Source #
Transform a SVG document to a XML node.
Manipulation functions
cssApply :: [CssRule] -> Tree -> Tree Source #
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 -> Document Source #
Rewrite the document by applying the CSS rules embedded inside it.
resolveUses :: Document -> Document Source #
Type definitions
module Graphics.SvgTree.Types