Crate svgmacro [−] [src]
Introduction to svgmacro
A macro for writing SVGs. Can write any valid XML-element. The result may be written to any file-like object. Handle variables and function calls by wrapping them in a {} closure, expressions begin with a @-symbol.
Examples
use std::fmt::Write; let mut out = String::new(); let width = 320; svg!(&mut out, svg (xmlns="http://www.w3.org/2000/svg" width={width} height="200") [ g [ g (id="paragraph" size="12")["This is the content of a group"] circle(cx="10" cy="10" r="10") @ for i in 0..3 { svg!(&mut out, circle(cx="10" cy="10" r="10")); }; ] ] );