Expand description
Embed typst packages directly in the binary.
§How to use
- Download package archives from https://typst.app/universe/search/?kind=packages
- Move those archives somewhere in the
src
directory - Include the archives with
include_package!
- Read the content of the archive with
Package::read_archive
(requires theread-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§
- File
read-archive
- A file from a package’s archive.
Functions§
- inspect_
archive read-archive
- Reads a tgz archive and calls the
inspect
callback for each file. - read_
archive read-archive
- Reads all the files of a tgz archive.