1 unstable release
new 0.2.0 | Jan 9, 2025 |
---|---|
0.1.0 |
|
#349 in Embedded development
198 downloads per month
91KB
117 lines
Typst-Embedded-Package
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),
]
);
lib.rs
:
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)
# use typst_embedded_package::{include_package, Package};
// 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),
]
);
Dependencies
~60MB
~860K SLoC