Skip to content

Commit

Permalink
doc: add init gif
Browse files Browse the repository at this point in the history
Signed-off-by: Brian McGee <[email protected]>
  • Loading branch information
brianmcgee committed May 3, 2024
1 parent 166a919 commit b01ea77
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 48 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file removed docs/public/fmt.gif
Binary file not shown.
Binary file added docs/public/init.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/treefmt.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 0 additions & 24 deletions docs/vhs/fmt.tape

This file was deleted.

29 changes: 29 additions & 0 deletions docs/vhs/init.tape
Original file line number Diff line number Diff line change
@@ -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"
36 changes: 36 additions & 0 deletions docs/vhs/treefmt.tape
Original file line number Diff line number Diff line change
@@ -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
36 changes: 13 additions & 23 deletions nix/docs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"'';
};
}
];
};
Expand Down

0 comments on commit b01ea77

Please sign in to comment.