Skip to content

Repository files navigation

typst-forge

The unofficial, conda-based package repository for Typst.

What is typst-forge?

typst-forge is an unofficial package repository for Typst. If is integrated into the conda ecosystem. We recommend using it with the pixi package manager.

You can see a list of packages on typst forge at https://prefix.dev/channels/typst-forge

typst-forge Typst Universe
Official ❌ ✅
Distributes packages ✅ ✅
Distributes templates ✅ ✅
Works using CLI ✅ ✅
Works using the web app ❌ ✅
Supports packages with large files ✅ ❌
Supports packages with fonts ✅ ❌
Also distributes Typst itself ✅ ❌
Also distributes other tools like linters and formatters ✅ ❌
Integrates with self-hosted repositories ✅ ❌
Supports multiple versions of one package in a project ❌ ✅

Using typst-forge

First install pixi.

To get started run pixi init -c conda-forge -c https://prefix.dev/typst-forge. This will create a pixi project with both the conda-forge and typst-forge channel. The typst-forge channel hosts typst packages, while conda-forge hosts typst itself and additional tools.

$ pixi init -c conda-forge -c https://prefix.dev/typst-forge
✔ Initialized project in /var/home/adrian/Documents/dev/typst/pixi.

Next add typst itself to your project. You can also specify the version you want to use. Though take note that typst-forge packages require at least typst 0.12.0.

$ pixi add 'typst==0.12.0'
✔ Added typst

You can now run Typst using pixi run typst.

With typst added you can add a package. All typst packages names are prefixed with typst-

$ pixi add 'typst-matryoshka==0.1.0'
✔ Added typst-matryoshka

When adding typst packages you should always specify a version. This is because Typst doesn't support import without version specification, you will need to manually keep your Typst imports and pixi dependencies in sync.

#import "@typst-forge/matryoshka:0.1.0": *

Instead of using pixi add you can also manually modify pixi.toml.

We recommend also adding a pixi task to build your project:

$ pixi task add compile "typst compile main.typ"
✔ Added task `compile`: typst compile main.typ

You can now run pixi run compile to compile your document.

Submitting packages

To submit a package to typst-forge you just need to fork this repository and create a pull request with your changes. Create a new directory for your package and copy and adjust the recipe.yaml file from another package. You can look at matroshka for how to create a package with a WASM plugin, at moderner-cv for how to create a template and at fontawesome for how to create a package with a font (The font itself is packaged on conda-forge, while the typst package only has a dependency on it.

You can test your recipes locally by running pixi run build <package-name>.

The full documentation for the recipe format can be found in the rattler-build documentation.

About

The unofficial, conda-based package repository for Typst.

Topics

Resources

Stars

13 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages