Skip to content

HSGamer/typst-plantuml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typst-plantuml

A Typst plugin to encode PlantUML diagrams and render them via the PlantUML server using prequery.

Usage

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

Options

  • 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",
)

How it works

  1. The plugin encodes your PlantUML source using deflate compression (via plantuml_encoding).
  2. It constructs a URL to the PlantUML server SVG endpoint.
  3. It uses prequery to download the rendered SVG and cache it locally.

Build from Source

To build the plugin and prepare it for distribution:

  1. Install Rust and Cargo.
  2. Install the wasm32-unknown-unknown target:
    rustup target add wasm32-unknown-unknown
  3. Run the build script:
    just build

The build artifacts will be available in dist/.

License

MIT

About

A Typst plugin to render PlantUML diagrams using prequery

Topics

Resources

License

Stars

Watchers

Forks

Contributors