doc: add init gif

Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
Brian McGee 2024-05-03 13:27:02 +01:00
parent 166a919fee
commit b01ea779aa
Signed by: brianmcgee
GPG Key ID: D49016E76AD1E8C0
8 changed files with 79 additions and 48 deletions

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

BIN
docs/public/init.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
docs/public/treefmt.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -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

29
docs/vhs/init.tape Normal file
View File

@ -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
docs/vhs/treefmt.tape Normal file
View File

@ -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

View File

@ -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 "$@"'';
};
}
];
};