#typst #package #binary

typst-embedded-package

Support to embed typst package to the binary

2 unstable releases

0.3.0 Mar 4, 2025
0.2.0 Jan 9, 2025
0.1.0 Jan 9, 2025

#546 in Embedded development

Download history 206/week @ 2025-01-05 33/week @ 2025-01-12 2/week @ 2025-02-02 1/week @ 2025-02-09 1/week @ 2025-02-16 3/week @ 2025-02-23 121/week @ 2025-03-02 16/week @ 2025-03-09 3/week @ 2025-03-16

140 downloads per month

MIT/Apache

105KB
117 lines

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)
# 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),
    ]
);

Typst-Embedded-Package

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),
    ]
);

Dependencies

~62MB
~893K SLoC