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
Popular Packages
The UI includes a curated list of popular packages:
| Package | Description |
|---|---|
booticons | Bootstrap Icons for Typst |
iconify | Iconify icon collection |
lucide | Lucide icon set |
fontawesome | Font Awesome icons |
nerd-icons | Nerd Font icon set |
codelst | Code listing with syntax highlighting |
tablem | Enhanced table utilities |
gridify | Flexible grid layouts |
Install a Package
- Go to Packages in the sidebar
- Click on a popular package, or use the Custom Install option
- Enter the package name and version (e.g.,
iconify:0.4.0) - 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 ReportManaging 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"}'