Quick Start
Quick Start
Section titled “Quick Start”Render a sequence diagram using the binding of your choice.
cargo add plantuml-engineuse plantuml_engine::render_svg;
fn main() -> Result<(), Box<dyn std::error::Error>> { let svg = render_svg("@startuml\nAlice -> Bob: hello\nBob --> Alice: hi\n@enduml")?; println!("{svg}"); Ok(())}The render function dispatches by FileFormat:
use plantuml_engine::render;use plantuml_core::FileFormat;
let svg = render("@startuml\nAlice -> Bob: hello\n@enduml", FileFormat::Svg)?;TypeScript (browser or Node.js)
Section titled “TypeScript (browser or Node.js)”npm install @vgerbot/plantumlimport { renderSvg } from '@vgerbot/plantuml';
const svg = await renderSvg('@startuml\nAlice -> Bob: hello\nBob --> Alice: hi\n@enduml');console.log(svg);The binding auto-detects the environment: in the browser it uses the web WASM target (ES module + fetch); in Node.js it uses the nodejs target (require + fs).
Maven coordinates:
<dependency> <groupId>com.vgerbot.plantuml</groupId> <artifactId>plantuml-java</artifactId> <version>0.1.0</version></dependency>import com.vgerbot.plantuml.PlantUml;
String svg = PlantUml.renderSvg("@startuml\nAlice -> Bob: hello\nBob --> Alice: hi\n@enduml");System.out.println(svg);Python
Section titled “Python”Planned (PyO3 + maturin). Not yet implemented.
- Language Reference — learn the diagram syntax
- Playground — experiment in the browser