A Typst plugin to encode PlantUML diagrams and render them via the PlantUML server using prequery.
Import the package and use the plantuml function:
#import "@preview/plantuml:0.1.0": plantuml
#plantuml("
@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi there
@enduml
", "assets/test1.svg")More examples can be found here
server: The PlantUML server URL. Defaults to"https://www.plantuml.com/plantuml".
#plantuml(
"@startuml\nA -> B: Hello\n@enduml",
server: "https://my-plantuml-server.com/plantuml",
)- The plugin encodes your PlantUML source using deflate compression (via plantuml_encoding).
- It constructs a URL to the PlantUML server SVG endpoint.
- It uses prequery to download the rendered SVG and cache it locally.
To build the plugin and prepare it for distribution:
- Install Rust and Cargo.
- Install the
wasm32-unknown-unknowntarget:rustup target add wasm32-unknown-unknown
- Run the build script:
just build
The build artifacts will be available in dist/.
MIT