docs.rs failed to build svg-0.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: svg-0.16.0

SVG Build Status

Currently the library is limited to the parsing of the data attribute of paths.

Documentation

Usage

#![feature(core)]

extern crate svg;

use svg::path::{Command, Data, Positioning};

fn main() {
    let data = Data::parse("M0,0 l0,1 1,0 0,-1 z").ok().unwrap();

    for command in data.iter() {
        match command {
            &Command::MoveTo(Positioning::Absolute, ref coordinates) => {
                println!("Move to {:?}.", coordinates);
            },
            &Command::LineTo(Positioning::Relative, ref coordinates) => {
                println!("Draw line segments between {:?}.", coordinates);
            },
            &Command::ClosePath => {
                println!("Close the path.");
            },
            _ => {
                println!("Not sure what to do.");
            }
        }
    }
}

Contributing

  1. Fork the project.
  2. Implement your idea.
  3. Create a pull request.