chore: add demos (#118)

* chore: add dataset for demos

* chore(demos): add demos

* chore: update CONTRIBUTING

* this copefully will fix comments gif
This commit is contained in:
Oleksandr Smirnov 2025-08-30 16:18:38 +03:00 committed by Oleksandr Smirnov
parent c0951c4769
commit 9bf72afc63
19 changed files with 204 additions and 2 deletions

20
vhs/Taskfile.yml Normal file
View file

@ -0,0 +1,20 @@
version: "3"
tasks:
generate:
deps:
- comment
- iferr
- tags
- impl
comment:
cmd: vhs comment.tape
iferr:
cmd: vhs iferr.tape
tags:
cmd: vhs tags.tape
impl:
cmd: vhs impl.tape

BIN
vhs/comment.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

7
vhs/comment.go Normal file
View file

@ -0,0 +1,7 @@
package demos
func doSomethingImportant() {}
type User struct{}
type DataProvider interface{}

34
vhs/comment.tape Normal file
View file

@ -0,0 +1,34 @@
Output comment.gif
Require nvim
Set FontFamily "JetBrains Mono"
Set Height 800
Set Width 1500
Set Padding 20
Set Shell "bash"
Set Theme "tokyonight"
Set TypingSpeed 250ms
Hide
Type@0ms "alias nvim='./nvim.sh'" Enter
Type@0ms "clear" Enter
Show
Type "nvim comment.go" Sleep 150ms Enter
# package
Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms
# func
Type "3j"
Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms
# struct
Type "3j"
Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms
# interface
Type "3j"
Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms
Sleep 5s

3
vhs/go.mod Normal file
View file

@ -0,0 +1,3 @@
module demos
go 1.25.0

BIN
vhs/iferr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

11
vhs/iferr.go Normal file
View file

@ -0,0 +1,11 @@
package demos
func ifErr() {
out, err := doSomething()
_ = out
}
func doSomething() (string, error) {
return "", nil
}

23
vhs/iferr.tape Normal file
View file

@ -0,0 +1,23 @@
Output iferr.gif
Require nvim
Require iferr
Set FontFamily "JetBrains Mono"
Set Height 800
Set Width 1500
Set Padding 20
Set Shell "bash"
Set Theme "tokyonight"
Set TypingSpeed 250ms
Hide
Type@0ms "alias nvim='./nvim.sh'" Enter
Type@0ms "clear" Enter
Show
Type "nvim iferr.go" Sleep 150ms Enter
Type "3j"
Type ":GoIfErr" Sleep 500ms Enter
Sleep 5s

BIN
vhs/impl.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

3
vhs/impl.go Normal file
View file

@ -0,0 +1,3 @@
package demos
type CloserExample struct{}

23
vhs/impl.tape Normal file
View file

@ -0,0 +1,23 @@
Output impl.gif
Require nvim
Require iferr
Set FontFamily "JetBrains Mono"
Set Height 800
Set Width 1500
Set Padding 20
Set Shell "bash"
Set Theme "tokyonight"
Set TypingSpeed 250ms
Hide
Type@0ms "alias nvim='./nvim.sh'" Enter
Type@0ms "clear" Enter
Show
Type "nvim impl.go" Sleep 150ms Enter
Type "2j"
Type ":GoImpl io.Reader" Sleep 500ms Enter
Sleep 5s

2
vhs/nvim.sh Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
nvim --clean -u "../scripts/minimal_init.lua" $@

BIN
vhs/tags.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

12
vhs/tags.go Normal file
View file

@ -0,0 +1,12 @@
package demos
type AddTagsToMe struct {
Name string
ID int
Address string
Aliases []string
Nested struct {
Foo string
Bar float32
}
}

36
vhs/tags.tape Normal file
View file

@ -0,0 +1,36 @@
Output tags.gif
Require nvim
Require gomodifytags
Set FontFamily "JetBrains Mono"
Set Height 800
Set Width 1500
Set Padding 20
Set Shell "bash"
Set Theme "tokyonight"
Set TypingSpeed 250ms
Hide
Type@0ms "alias nvim='./nvim.sh'" Enter
Type@0ms "clear" Enter
Show
Type "nvim tags.go" Sleep 150ms Enter
Type "3j"
Type ":GoTagAdd json yaml" Sleep 500ms Enter
Type@120ms ":w" Enter
Sleep 1s
Type ":GoTagRm json" Sleep 500ms Enter
Type@120ms ":w" Enter
Sleep 1s
Type ":GoTagClear" Sleep 500ms Enter
Type@120ms ":w" Enter
Sleep 1s
Type "jV2j"
Type ":GoTagAdd xml" Sleep 500ms Enter
Sleep 5s