cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
733 stars 34 forks source link

canvas: Add runtime version check for add-ons #595

Closed johannes-wolf closed 3 weeks ago

johannes-wolf commented 1 month ago

This allows other libs checking the cetz version number at runtime for compat. Code can require a minimum version using the new assert-version element (as long as the internal API does not completely change).

Example (somelib/shapes.typ):

#let my-shape(...) = {
  import cetz.draw: *
  assert-version(version(0,2,2), hint: "somelib")

  rect(...)
}

This is a solution to improve the current module/version situation until Typst supports some kind of version negotiation.

johannes-wolf commented 3 weeks ago

This is wanted/needed for the cetz-plot split!