No description
|
||
---|---|---|
.forgejo/workflows | ||
checks | ||
lib | ||
overlays | ||
shells | ||
templates | ||
.gitignore | ||
flake.lock | ||
flake.nix | ||
main.pdf | ||
README.md |
Typst-nix
A nix library to develop and build Typst projects.
Features
- Unit Tests
- Create packages
- Allow fonts
- Watch script configured like the build environment.
- Shell environment configures like the build environment.
- Support almost all Typst command line options.
Documentation
lib.<system>.mkTypstDerivation
Inputs
{
src,
name ? removeSuffix ".typ" (baseNameOf entrypoint),
entrypoint ? "main.typ",
fonts ? [ ],
packages ? [ ],
inputs ? { },
format ? "pdf", # The format of the output file.
ppi ? 144, # The PPI (pixels per inch) to use for PNG export
typst ? args.typst,
numberFormat ? "{0p}-of-{t}", # The format of the output file, inferred from the extension by default.
creationTimestamp ? 0, # The document's creation date formatted as a UNIX timestamp.
pages ? "1-", # Which pages to export. When unspecified, all document pages are exported.
jobs ? 0, # Number of parallel jobs spawned during compilation, defaults to number of CPUs.
timings ? false, # Produces performance timings of the compilation process (experimental).
}
lib.<system>.mkWatchTypstProject
Inputs
{
name ? removeSuffix ".typ" (baseNameOf entrypoint),
entrypoint ? "main.typ",
fonts ? [ ],
packages ? [ ],
inputs ? { },
format ? "pdf", # The format of the output file.
ppi ? 144, # The PPI (pixels per inch) to use for PNG export
typst ? args.typst,
numberFormat ? "{0p}-of-{t}", # The format of the output file, inferred from the extension by default.
creationTimestamp ? 0, # The document's creation date formatted as a UNIX timestamp.
pages ? "1-", # Which pages to export. When unspecified, all document pages are exported.
jobs ? 0, # Number of parallel jobs spawned during compilation, defaults to number of CPUs.
open ? false,
viewer ?
if format == "html" then
getExe xdg-utils # Open in default browser.
else
getExe zathura, # Open in a lightweight, automatically reloading PDF and image viewer.
out ? null, # Which directory to save the temporary output. Default: Create a new temporary directory.
keepOut ? false,
timings ? false, # Produces performance timings of the compilation process (experimental).
port ? null, # The port where HTML is served.
noServe ? false, # Disables the built-in HTTP server for HTML export.
noReload ? false, # Disables the injected live reload script for HTML export.
}