diff --git a/docs/public/fmt.gif b/docs/public/fmt.gif index 67f467d..840d8b2 100644 Binary files a/docs/public/fmt.gif and b/docs/public/fmt.gif differ diff --git a/docs/vhs/fmt.tape b/docs/vhs/fmt.tape index cd1bf84..e659dc2 100644 --- a/docs/vhs/fmt.tape +++ b/docs/vhs/fmt.tape @@ -1,20 +1,24 @@ -Require nix +Require treefmt Set Shell zsh -Set FontSize 14 +Set FontSize 11 Set Theme "Catppuccin Mocha" -Set Width 720 -Set Height 400 +Set Width 320 +Set Height 220 +Set Padding 20 -Type "nix fmt -- -v -c" +Type "treefmt -c" +Sleep 1s Enter Sleep 3s - Enter -Type "nix fmt -- -v" +Enter +Sleep 1s + +Type "treefmt" Enter -Sleep 3s \ No newline at end of file +Sleep 5s \ No newline at end of file diff --git a/nix/docs.nix b/nix/docs.nix index e595896..9232186 100644 --- a/nix/docs.nix +++ b/nix/docs.nix @@ -57,14 +57,24 @@ _: { { category = "docs"; help = "regenerate gifs for docs"; - name = "gifs"; - command = '' - set -xeuo pipefail - - for tape in $PRJ_ROOT/docs/vhs/*; do - vhs $tape -o "$PRJ_ROOT/docs/public/$(basename $tape .tape).gif" - done - ''; + package = let + treefmt = pkgs.writeShellApplication { + name = "treefmt"; + runtimeInputs = [self'.packages.treefmt] ++ (import ./formatters.nix pkgs); + text = '' + treefmt -C "$PRJ_ROOT/test/examples" --allow-missing-formatter "$@" + ''; + }; + in + pkgs.writeShellApplication { + name = "gifs"; + runtimeInputs = [treefmt]; + text = '' + for tape in "$PRJ_ROOT"/docs/vhs/*; do + vhs "$tape" -o "$PRJ_ROOT/docs/public/$(basename "$tape" .tape).gif" + done + ''; + }; } ]; };