diff --git a/docs/index.md b/docs/index.md index 62c9c2d..16543cb 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,7 +6,7 @@ hero: name: "Treefmt" text: "One CLI to format your repo" image: - src: /fmt.gif + src: /treefmt.gif alt: Treefmt actions: - theme: brand diff --git a/docs/public/fmt.gif b/docs/public/fmt.gif deleted file mode 100644 index 0cc4529..0000000 Binary files a/docs/public/fmt.gif and /dev/null differ diff --git a/docs/public/init.gif b/docs/public/init.gif new file mode 100644 index 0000000..f9a0f79 Binary files /dev/null and b/docs/public/init.gif differ diff --git a/docs/public/treefmt.gif b/docs/public/treefmt.gif new file mode 100644 index 0000000..58f7ffa Binary files /dev/null and b/docs/public/treefmt.gif differ diff --git a/docs/vhs/fmt.tape b/docs/vhs/fmt.tape deleted file mode 100644 index e659dc2..0000000 --- a/docs/vhs/fmt.tape +++ /dev/null @@ -1,24 +0,0 @@ -Require treefmt - -Set Shell zsh -Set FontSize 11 - -Set Theme "Catppuccin Mocha" - -Set Width 320 -Set Height 220 -Set Padding 20 - -Type "treefmt -c" -Sleep 1s -Enter - -Sleep 3s -Enter -Enter -Sleep 1s - -Type "treefmt" -Enter - -Sleep 5s \ No newline at end of file diff --git a/docs/vhs/init.tape b/docs/vhs/init.tape new file mode 100644 index 0000000..5c9591d --- /dev/null +++ b/docs/vhs/init.tape @@ -0,0 +1,29 @@ +Require treefmt +Require nano + +Set Shell zsh +Set FontSize 14 + +Set Theme "Catppuccin Mocha" + +Set Width 720 +Set Height 360 +Set Padding 20 + +Hide +Type "TEMP_DIR=$(mktemp -d) && cd $TEMP_DIR && clear" +Enter + +Show +Type "treefmt --init" +Enter +Sleep 2s + +Type "nano treefmt.toml" +Enter +Sleep 5s + +Ctrl+x + +Hide +Type "cd && rm -rf $TEMP_DIR" diff --git a/docs/vhs/treefmt.tape b/docs/vhs/treefmt.tape new file mode 100644 index 0000000..4f5e061 --- /dev/null +++ b/docs/vhs/treefmt.tape @@ -0,0 +1,36 @@ +Require rsync +Require treefmt + +Set Shell zsh +Set FontSize 11 + +Set Theme "Catppuccin Mocha" + +Set Width 320 +Set Height 220 +Set Padding 20 + +Hide +Type "TEMP_DIR=$(mktemp -d) && rsync -av $PRJ_ROOT/test/examples/ $TEMP_DIR && cd $TEMP_DIR && clear" +Enter +Type "alias treefmt='treefmt --allow-missing-formatter' && clear" +Enter +Show + +Type "treefmt -c" +Sleep 1s +Enter + +Sleep 3s +Enter +Enter +Sleep 1s + +Type "treefmt" +Enter + +Sleep 5s + +Hide +Type "cd && rm -rf $TEMP_DIR" +Enter \ No newline at end of file diff --git a/nix/docs.nix b/nix/docs.nix index 9232186..874b1f7 100644 --- a/nix/docs.nix +++ b/nix/docs.nix @@ -51,30 +51,20 @@ _: { } { inherit category; - package = pkgs.vhs; + name = "vhs"; help = "generate terminal gifs"; - } - { - category = "docs"; - help = "regenerate gifs for docs"; - 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 - ''; - }; + + package = pkgs.writeShellApplication { + name = "gif"; + runtimeInputs = + [ + self'.packages.treefmt + pkgs.rsync + pkgs.vhs + ] + ++ (import ./formatters.nix pkgs); + text = ''vhs "$@"''; + }; } ]; };