Releases: RossSmyth/press
v2.1: Support input flags and devShell tooling
Previously, when using a devShell, Tinymist would fail to find the packages and fonts that are used. This is because the fonts and packages are registered with environment variables in a wrapper. Now these are exposed with a shellHook, so the devShell should properly pick up these environment variables as well now.
Changes
- Expose
TYPST_PACKAGE_CACHE_PATH
(Typst Universe dependencies),TYPST_PACKAGE_PATH
(custom dependencies), andTYPST_FONT_PATHS
(fonts) to the devShell - Support
input
arguments
Key-value arguments on the CLI provided with --input key=value
https://typst.app/docs/reference/foundations/sys/
buildTypstDocument {
name = "inputs";
src = ./.;
inputs = {
language = "en";
name = "John Doe";
};
};
Value of "sys.inputs.language" is #sys.inputs.language
#if sys.inputs.name != "John Doe" {
panic("Expected 'John Doe' in 'sys.inputs.name' but got " + sys.inputs.flag)
}
Huge shout-out to @jbgi for doing most of the legwork for both of these changes!
v2.0: Nixpkgs typstPackages support
Recently, Nixpkgs merged all packages in Typst Universe into the repo.
This is very convenient for me because that means that rather than pulling in the entire Universe repo, the user can not specify what exactly they would like. So here it is
Changes:
- No longer vendor Typst Universe into the nix store for every document
Documents should build much faster now. - [Breaking] Remove unused or deprecated attributes
typstPatches
,typstUniverse
, anduniversePatches
- Add
verbose
attribute
Controls how verbose the Typst compiler session is - Add nice assert messages
- [Breaking] Remove support for all the different datatypes for the
extraPackages
key.
It used to accept a value, a list, an attributeset of values, and an attribute set of lists. Now it only accepts an attribute set of lists.
See the template for full details, but essentially it looks like this now:
pkgs.buildTypstDocument {
name = "foo";
src = ./.;
typstEnv = p: [ p.note-me ];
}
Regressions:
This package does not scan the custom packages pulled in. This means that if you use a custom package that relies on having a Universe package that is not added to typstEnv
, compilation will fail. Tracked in #10
v1.4: devShell support
Per the discussion in #7 support for devShells has been added. Thanks @augu5te!
- Internally, rather than setting up the environment in the build shell, it now creates a wrapper around Typst. This wrapper is added to the environment when a shell is created 903728d
- A devShell was added to the template b2c2107
Minor:
v1.3.1: Fix extraPackages failing with fetchTree output
My tests used fetchFromGitHub
. Which is one way to receive a FOD. But flakes internally use fetchTree
. But when you use flake = false
, it turns out the output is not actually a derivation. And since my code checked to see if it was a derivation, it failed and attempted to use it as an attrset. This is quite goofy. But a hack is implemented, I'm unsure if it is canonical or not. But it now works and is tested as intended.
v1.3: Supports more types of extraPackages input
the extraPackages
attribute on now supports more input types:
Lists of packages. The namespace defaults to "local"
gitImportList = buildTypstDocument (self: {
name = "gitImport";
src = ./documents;
file = "gitImport.typ";
extraPackages = [note-me];
});
A string store path to a package. Namespace is "local".
gitImportString = buildTypstDocument (self: {
name = "gitImport";
src = ./documents;
file = "gitImport.typ";
extraPackages = "${note-me}";
});
A package derivation. Namespace is "local".
gitImportDrv = buildTypstDocument (self: {
name = "gitImport";
src = ./documents;
file = "gitImport.typ";
extraPackages = note-me;
});
A (store) path. Namespace is "local".
gitImportDrv = buildTypstDocument (self: {
name = "gitImport";
src = ./documents;
file = "gitImport.typ";
extraPackages = ./noteMe;
});
An attribute set with namespace keys and individual packages as the values.
gitImportAttrStr = buildTypstDocument (self: {
name = "gitImport";
src = ./documents;
file = "gitImport.typ";
extraPackages = {
local = "${note-me}";
myName = note-me;
anotherName = ./noteMe;
};
});
1.2.1: Fix HTML format output
It was broken before as I never tested it. Now it Just Works:tm:
1.2: Patching Typst Universe packages
Can now patch Typst Universe.
patchUni = buildTypstDocument (self: {
name = "patchUni";
src = ./documents;
file = "patchUni.typ";
universePatches = [
./universe.patch
];
});
--- a/packages/preview/note-me/0.5.0/lib.typ
+++ b/packages/preview/note-me/0.5.0/lib.typ
@@ -1,2 +1,2 @@
-#import "note-me.typ": admonition, note, tip, important, warning, caution
-#import "note-me-more.typ": todo
\ No newline at end of file
+#import "note-me.typ": admonition, bote, tip, important, warning, caution
+#import "note-me-more.typ": todo
--- a/packages/preview/note-me/0.5.0/note-me.typ
+++ b/packages/preview/note-me/0.5.0/note-me.typ
@@ -80,7 +80,7 @@
],
)
-#let note(title: "Note", children) = admonition(
+#let bote(title: "Note", children) = admonition(
icon-path: "icons/info.svg",
title: title,
color: rgb(9, 105, 218),
#import "@preview/note-me:0.5.0": bote
#bote[
Success!
]
Minor: Fixed template syntax mistake and added test for patching the document itself.
1.1: Font support
- Support arbitrary fonts
fonts = buildTypstDocument (self: {
name = "fonts";
src = ./documents;
file = "fonts.typ";
fonts = [
fira-code
inconsolata
];
});