Skip to content

Packages

Better Reports supports installing Typst community packages from the official package registry. Packages are installed locally per instance.

Install from Script

The first time you run the app, packages are installed automatically via the ensure-packages.mjs script. This script scans templates for @preview/package:version imports and installs any missing packages.

Managing Packages via the UI

The UI includes a curated list of popular packages:

PackageDescription
booticonsBootstrap Icons for Typst
iconifyIconify icon collection
lucideLucide icon set
fontawesomeFont Awesome icons
nerd-iconsNerd Font icon set
codelstCode listing with syntax highlighting
tablemEnhanced table utilities
gridifyFlexible grid layouts

Install a Package

  1. Go to Packages in the sidebar
  2. Click on a popular package, or use the Custom Install option
  3. Enter the package name and version (e.g., iconify:0.4.0)
  4. Click Install

View Installed Packages

The packages page shows all installed packages with:

  • Package name and version
  • Description
  • License
  • Delete option

Missing Package Detection

When a compilation error indicates a missing package, Better Reports automatically detects and installs it. You can also manually check a template:

bash
curl -X POST http://localhost:3000/api/packages/check \
  -H "Content-Type: application/json" \
  -d '{"template": "my-template"}'

Using Packages in Templates

typst
#import "@preview/iconify:0.4.0": icon

// Use icons in your report
#icon("mdi:account") Student Report

Managing Packages via the API

bash
# List installed packages
curl http://localhost:3000/api/packages

# Install a package
curl -X POST http://localhost:3000/api/packages \
  -H "Content-Type: application/json" \
  -d '{"name": "iconify", "version": "0.4.0"}'

# Delete a package
curl -X DELETE http://localhost:3000/api/packages \
  -H "Content-Type: application/json" \
  -d '{"name": "iconify", "version": "0.4.0"}'

Design and Dev by David Lam