tmorin / plantuml-generator

A command line utility to generate stuff with and for PlantUML.
MIT License
10 stars 2 forks source link

Generating other output formats #11

Closed jayvdb closed 1 month ago

jayvdb commented 2 months ago

The table on https://plantuml.com/command-line shows a lot of output formats.

It would be nice to be able to specify the desired format. I only need svg, which works when I do

diff --git a/src/plantuml.rs b/src/plantuml.rs
index 587d5c2..3218889 100644
--- a/src/plantuml.rs
+++ b/src/plantuml.rs
@@ -35,6 +35,7 @@ impl PlantUML {
             .arg("-jar")
             .arg(&self.plantuml_jar)
             .arg(source)
+            .arg("-svg")
             .output()
             .map_err(|e| anyhow::Error::new(e).context(format!("unable to render {}", source)))?;
         io::stdout().write_all(&output.stdout).unwrap();
jayvdb commented 1 month ago

Thanks @tmorin , your proposed solution looks very useful, solving this and other similar problems.