Expand description
§svgdx - create SVG diagrams easily
svgdx
is normally run as a command line tool, taking an input file and processing
it into an SVG output file.
§Library use
Support as a library is primarily to allow other front-ends to convert svgdx
documents to SVG without having to call svgdx
as a command-line subprocess.
A TransformConfig
object should be created as appropriate to configure the
transform process, and the appropriate transform_*
function called passing
this and appropriate input / output parameters as required.
Errors in processing are handled via svgdx::Result
; currently these are mainly
useful in providing basic error messages suitable for end-users.
§Example
let cfg = svgdx::TransformConfig::default();
let input = r#"<rect wh="50" text="Hello!"/>"#;
let output = svgdx::transform_str(input, &cfg).unwrap();
println!("{output}");
Modules§
Structs§
- Transform
Config - Settings to configure a single transformation.
Constants§
Functions§
- transform_
file - Read file from
input
(‘-’ for stdin), process the result, and write to file given byoutput
(‘-’ for stdout). - transform_
str - transform_
str_ default - Transform the provided
input
string using default config, returning the result string. - transform_
stream - Reads from the
reader
stream, processes document, and writes towriter
. - transform_
string - Transform
input
provided as a string, returning the result as a string.