pub fn version() -> TypstVersionExpand description
Returns the version of Typst.
The information is read from the following sources:
- For the version number: The
TYPST_VERSIONenvironment variable - For the commit hash: The
TYPST_COMMIT_SHAenvironment 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.