Crate svgdx

Source
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§

cli
server

Structs§

TransformConfig
Settings to configure a single transformation.

Constants§

VERSION

Functions§

transform_file
Read file from input (‘-’ for stdin), process the result, and write to file given by output (‘-’ 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 to writer.
transform_string
Transform input provided as a string, returning the result as a string.

Type Aliases§

Result