Crate typst_embedded_package

Source
Expand description

Embed typst packages directly in the binary.

§How to use

  1. Download package archives from https://typst.app/universe/search/?kind=packages
  2. Move those archives somewhere in the src directory
  3. Include the archives with include_package!
  4. Read the content of the archive with Package::read_archive (requires the read-archive feature)
// Embed the package located at "/src/typst-packages/preview/cetz-0.3.1.tar.gz"
const CETZ: Package = include_package!("typst-packages" "preview" "cetz" (0, 3, 1));

// Embed multiple packages.
const PACKAGES: [Package; 2] = include_package!(
    "typst-packages"
    [
        "preview" "cetz" (0, 3, 1),
        "preview" "oxifmt" (0, 2, 0),
    ]
);

Macros§

include_package
Embed one or more typst package as tgz archive.

Structs§

Package
Information about an embedded package.

Enums§

Fileread-archive
A file from a package’s archive.

Functions§

inspect_archiveread-archive
Reads a tgz archive and calls the inspect callback for each file.
read_archiveread-archive
Reads all the files of a tgz archive.