Skip to main content

version

Function version 

Source
pub fn version() -> TypstVersion
Expand description

Returns the version of Typst.

The information is read from the following sources:

  • For the version number: The TYPST_VERSION environment variable
  • For the commit hash: The TYPST_COMMIT_SHA environment variable

Build tooling can set these environment variables to configure the exposed information. If the environment variables are left unset, the values are populated via build.rs from the Cargo package manifest version and the git hash in the current repository (if any).

§Panics

If the TYPST_VERSION environment variable holds a version string that doesn’t conform to SemVer.