Skip to content

Commit 8a621a0

Browse files
committed
docs: generate demo video for README
1 parent 3a96806 commit 8a621a0

File tree

7 files changed

+137
-9
lines changed

7 files changed

+137
-9
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: build install release changelog test-release-process test-rpm-install
22
./dist/git-cc: ./main.go ./go.mod ./go.sum ./pkg/**/*.go
3-
go build -o ./dist
3+
go build -o ./dist/git-cc
44
build: ./dist/git-cc
55
unit-test:
66
go test ./...
@@ -12,6 +12,9 @@ test-rpm-install: test-release-process
1212
docker run -v ${PWD}/dist:/dist centos bash -c 'rpm -i /dist/git-cc*_linux_amd64.rpm && git-cc --version'
1313
#^ requires that GITHUB_TOKEN be set, and the token have the 'repo' scope
1414

15+
./assets/demo.mp4: ./assets/demo.tape
16+
cat ./assets/demo.tape | vhs
17+
1518
changelog:
1619
pnpx standard-version
1720
release:

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ a git extension to help write [conventional commits][cc-standard]
77

88
## Usage
99

10-
![demo video](./assets/demo.gif)
10+
<details><summary>Video</summary>
11+
<div>
12+
<video controls src="./assets/demo.mp4" muted="true">
13+
</video>
14+
</div>
15+
</details>
1116

1217
```sh
1318
# you can invoke either of the below to

assets/demo.gif

263 KB
Loading

assets/demo.mp4

386 KB
Binary file not shown.

assets/demo.tape

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# VHS documentation
2+
#
3+
# Output:
4+
# Output <path>.gif Create a GIF output at the given <path>
5+
# Output <path>.mp4 Create an MP4 output at the given <path>
6+
# Output <path>.webm Create a WebM output at the given <path>
7+
#
8+
# Settings:
9+
# Set FontSize <number> Set the font size of the terminal
10+
# Set FontFamily <string> Set the font family of the terminal
11+
# Set Height <number> Set the height of the terminal
12+
# Set Width <number> Set the width of the terminal
13+
# Set LetterSpacing <float> Set the font letter spacing (tracking)
14+
# Set LineHeight <float> Set the font line height
15+
# Set Theme <string> Set the theme of the terminal (JSON)
16+
# Set Padding <number> Set the padding of the terminal
17+
# Set Framerate <number> Set the framerate of the recording
18+
# Set PlaybackSpeed <float> Set the playback speed of the recording
19+
#
20+
# Sleep:
21+
# Sleep <time> Sleep for a set amount of <time> in seconds
22+
#
23+
# Type:
24+
# Type[@<time>] "<characters>" Type <characters> into the terminal with a
25+
# <time> delay between each character
26+
#
27+
# Keys:
28+
# Backspace[@<time>] [number] Press the Backspace key
29+
# Down[@<time>] [number] Press the Down key
30+
# Enter[@<time>] [number] Press the Enter key
31+
# Space[@<time>] [number] Press the Space key
32+
# Tab[@<time>] [number] Press the Tab key
33+
# Left[@<time>] [number] Press the Left Arrow key
34+
# Right[@<time>] [number] Press the Right Arrow key
35+
# Up[@<time>] [number] Press the Up Arrow key
36+
# Down[@<time>] [number] Press the Down Arrow key
37+
# Ctrl+<key> Press the Control key + <key> (e.g. Ctrl+C)
38+
#
39+
# Display:
40+
# Hide Hide the subsequent commands from the output
41+
# Show Show the subsequent commands in the output
42+
43+
Output assets/demo.gif
44+
Output assets/demo.mp4
45+
46+
Set FontSize 24
47+
Set Width 1200
48+
Set Height 800
49+
50+
Hide
51+
Type@1ms "export PATH=$(pwd)/dist:$PATH old_dir=$(pwd) new_dir=/tmp/git-repo"
52+
Enter
53+
Type@1ms "rm -rf $new_dir && mkdir -p $new_dir && cd $new_dir"
54+
Enter
55+
Type@1ms "cp $old_dir/commit_convention.yaml $new_dir && git init && git checkout -b main"
56+
Enter
57+
Type@1ms "touch ./foo && git add foo"
58+
Enter
59+
Type "clear"
60+
Enter
61+
62+
Type "export EDITOR=vi"
63+
Enter
64+
Show
65+
66+
# start the TUI
67+
Type "git cc"
68+
Sleep 300ms
69+
Enter
70+
71+
# navigate the type-selector
72+
Sleep 400ms
73+
Type@250ms "fe"
74+
Sleep 400ms
75+
Enter
76+
77+
# navigate the scope-selector
78+
Sleep 400ms
79+
Type "scope"
80+
Sleep 400ms
81+
Enter
82+
83+
# enter a new scope
84+
Sleep 200ms
85+
Escape
86+
Type "12G"
87+
Enter
88+
Type "$"
89+
Type "i"
90+
Right
91+
Enter
92+
Backspace 2
93+
Type "- scope: description of scope"
94+
Escape
95+
Type ":wq"
96+
Enter
97+
Sleep 500ms
98+
Enter
99+
100+
# describe change
101+
Sleep 500ms
102+
Type "informative message about the change"
103+
Sleep 200ms
104+
Enter
105+
106+
# describe a breaking change
107+
Sleep 500ms
108+
Type "what this commit broke"
109+
Sleep 500ms
110+
Enter
111+
112+
# fill out remaining detail
113+
Type "3G"
114+
Type "i"
115+
Enter 2
116+
Up 2
117+
Type "additional details"
118+
Enter
119+
Escape
120+
Type ":wq"
121+
Enter
122+
Sleep 200ms

commit_convention.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ scopes:
1010
- cli: UI for command-line invocation
1111
- dist: the release; means of distribution
1212
- devtools: tools for development
13-

flake.nix

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
outputs = { self, flake-utils, nixpkgs }:
88
flake-utils.lib.eachDefaultSystem (system:
9-
# packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
10-
# packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
119
let
1210
pkgs = (import nixpkgs) {
1311
inherit system;
@@ -16,7 +14,7 @@
1614
rec {
1715
devShell = pkgs.mkShell {
1816
nativeBuildInputs = with pkgs; [
19-
go # 1.19
17+
go # 1.19.x
2018
];
2119
buildInputs = with pkgs; [
2220
nixpkgs-fmt
@@ -26,9 +24,10 @@
2624
nodejs
2725
nodePackages.pnpm
2826
goreleaser
29-
# ttyd
30-
# ffmpeg
31-
# vhs
27+
ttyd
28+
ffmpeg
29+
vhs
30+
bashInteractive
3231
];
3332
};
3433
}

0 commit comments

Comments
 (0)