mirror of
https://github.com/charmbracelet/gum.git
synced 2024-09-11 06:16:03 +03:00
docs: add new gifs (#533)
* docs: add new gifs * Update README.md * docs: spin.gif * docs: add spin.gif to readme * fix: lint * don't commit filter.tape
This commit is contained in:
parent
2a35019323
commit
f75dfa668f
26
README.md
26
README.md
@ -130,7 +130,7 @@ export GUM_INPUT_WIDTH=80
|
||||
gum input
|
||||
```
|
||||
|
||||
<img alt="Gum input displaying most customization options" width="600" src="https://stuff.charm.sh/gum/customization.gif">
|
||||
<img alt="Gum input displaying most customization options" width="600" src="https://vhs.charm.sh/vhs-5zb9DlQYA70aL9ZpYLTwKv.gif">
|
||||
|
||||
## Input
|
||||
|
||||
@ -141,7 +141,7 @@ gum input > answer.txt
|
||||
gum input --password > password.txt
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/input_1.gif" width="600" alt="Shell running gum input typing Not much, you?" />
|
||||
<img src="https://vhs.charm.sh/vhs-1nScrStFI3BMlCp5yrLtyg.gif" width="600" alt="Shell running gum input typing Not much, you?" />
|
||||
|
||||
## Write
|
||||
|
||||
@ -151,7 +151,7 @@ Prompt for some multi-line text (`ctrl+d` to complete text entry).
|
||||
gum write > story.txt
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/write.gif" width="600" alt="Shell running gum write typing a story" />
|
||||
<img src="https://vhs.charm.sh/vhs-7abdKKrUEukgx9aJj8O5GX.gif" width="600" alt="Shell running gum write typing a story" />
|
||||
|
||||
## Filter
|
||||
|
||||
@ -164,7 +164,7 @@ echo Cherry >> flavors.txt
|
||||
gum filter < flavors.txt > selection.txt
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/filter.gif" width="600" alt="Shell running gum filter on different bubble gum flavors" />
|
||||
<img src="https://vhs.charm.sh/vhs-61euOQtKPtQVD7nDpHQhzr.gif" width="600" alt="Shell running gum filter on different bubble gum flavors" />
|
||||
|
||||
Select multiple options with the `--limit` flag or `--no-limit` flag. Use `tab` or `ctrl+space` to select, `enter` to confirm.
|
||||
|
||||
@ -191,7 +191,7 @@ cat songs.txt | gum choose --limit 5
|
||||
cat foods.txt | gum choose --no-limit --header "Grocery Shopping"
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/choose.gif" width="600" alt="Shell running gum choose with numbers and gum flavors" />
|
||||
<img src="https://vhs.charm.sh/vhs-3zV1LvofA6Cbn5vBu1NHHl.gif" width="600" alt="Shell running gum choose with numbers and gum flavors" />
|
||||
|
||||
## Confirm
|
||||
|
||||
@ -202,7 +202,7 @@ Confirm whether to perform an action. Exits with code `0` (affirmative) or `1`
|
||||
gum confirm && rm file.txt || echo "File not removed"
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/confirm_2.gif" width="600" alt="Shell running gum confirm" />
|
||||
<img src="https://vhs.charm.sh/vhs-3xRFvbeQ4lqGerbHY7y3q2.gif" width="600" alt="Shell running gum confirm" />
|
||||
|
||||
## File
|
||||
|
||||
@ -212,7 +212,7 @@ Prompt the user to select a file from the file tree.
|
||||
EDITOR $(gum file $HOME)
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/file.gif" width="600" alt="Shell running gum file" />
|
||||
<img src="https://vhs.charm.sh/vhs-2RMRqmnOPneneIgVJJ3mI1.gif" width="600" alt="Shell running gum file" />
|
||||
|
||||
## Pager
|
||||
|
||||
@ -222,7 +222,7 @@ Scroll through a long document with line numbers and a fully customizable viewpo
|
||||
gum pager < README.md
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/pager.gif" width="600" alt="Shell running gum pager" />
|
||||
<img src="https://vhs.charm.sh/vhs-3iMDpgOLmbYr0jrYEGbk7p.gif" width="600" alt="Shell running gum pager" />
|
||||
|
||||
## Spin
|
||||
|
||||
@ -235,7 +235,7 @@ To view or pipe the command's output, use the `--show-output` flag.
|
||||
gum spin --spinner dot --title "Buying Bubble Gum..." -- sleep 5
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/spin.gif" width="600" alt="Shell running gum spin while sleeping for 5 seconds" />
|
||||
<img src="https://vhs.charm.sh/vhs-3YFswCmoY4o3Q7MyzWl6sS.gif" width="600" alt="Shell running gum spin while sleeping for 5 seconds" />
|
||||
|
||||
Available spinner types include: `line`, `dot`, `minidot`, `jump`, `pulse`, `points`, `globe`, `moon`, `monkey`, `meter`, `hamburger`.
|
||||
|
||||
@ -247,7 +247,7 @@ Select a row from some tabular data.
|
||||
gum table < flavors.csv | cut -d ',' -f 1
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/table.gif" width="600" alt="Shell running gum table" />
|
||||
<!-- <img src="https://stuff.charm.sh/gum/table.gif" width="600" alt="Shell running gum table" /> -->
|
||||
|
||||
## Style
|
||||
|
||||
@ -260,7 +260,7 @@ gum style \
|
||||
'Bubble Gum (1¢)' 'So sweet and so fresh!'
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/style.gif" width="600" alt="Bubble Gum, So sweet and so fresh!" />
|
||||
<img src="https://github.com/charmbracelet/gum/assets/42545625/67468acf-b3e0-4e78-bd89-360739eb44fa" width="600" alt="Bubble Gum, So sweet and so fresh!" />
|
||||
|
||||
## Join
|
||||
|
||||
@ -281,7 +281,7 @@ BUBBLE_GUM=$(gum join "$BUBBLE" "$GUM")
|
||||
gum join --align center --vertical "$I_LOVE" "$BUBBLE_GUM"
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/join.gif" width="600" alt="I LOVE Bubble Gum written out in four boxes with double borders around them." />
|
||||
<img src="https://github.com/charmbracelet/gum/assets/42545625/68f7a25d-b495-48dd-982a-cee0c8ea5786" width="600" alt="I LOVE Bubble Gum written out in four boxes with double borders around them." />
|
||||
|
||||
## Format
|
||||
|
||||
@ -308,7 +308,7 @@ For more information on template helpers, see the [Termenv
|
||||
docs](https://github.com/muesli/termenv#template-helpers). For a full list of
|
||||
named emojis see the [GitHub API](https://api.github.com/emojis).
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/format.gif" width="600" alt="Running gum format for different types of formats" />
|
||||
<img src="https://github.com/charmbracelet/gum/assets/42545625/5cfbb0c8-0022-460d-841b-fec37527ca66" width="300" alt="Running gum format for different types of formats" />
|
||||
|
||||
## Log
|
||||
|
||||
|
1
examples/.gitignore
vendored
1
examples/.gitignore
vendored
@ -1 +1,2 @@
|
||||
*.gif
|
||||
*.png
|
||||
|
36
examples/README.md
Normal file
36
examples/README.md
Normal file
@ -0,0 +1,36 @@
|
||||
# Glamour
|
||||
|
||||
A casual introduction. 你好世界!
|
||||
|
||||
## Let's talk about artichokes
|
||||
|
||||
The artichoke is mentioned as a garden
|
||||
plant in the 8th century BC by Homer
|
||||
and Hesiod. The naturally occurring
|
||||
variant of the artichoke, the cardoon,
|
||||
which is native to the Mediterranean
|
||||
area, also has records of use as a
|
||||
food among the ancient Greeks and
|
||||
Romans. Pliny the Elder mentioned
|
||||
growing of 'carduus' in Carthage
|
||||
and Cordoba.
|
||||
|
||||
He holds him with his skinny hand,
|
||||
There was ship,' quoth he.
|
||||
'Hold off! unhand me, grey-beard loon!'
|
||||
An artichoke dropt he.
|
||||
|
||||
## Other foods worth mentioning
|
||||
|
||||
1. Carrots
|
||||
2. Celery
|
||||
3. Tacos
|
||||
• Soft
|
||||
• Hard
|
||||
4. Cucumber
|
||||
|
||||
## Things to eat today
|
||||
|
||||
* Carrots
|
||||
* Ramen
|
||||
* Currywurst
|
26
examples/choose.tape
Normal file
26
examples/choose.tape
Normal file
@ -0,0 +1,26 @@
|
||||
Output choose.gif
|
||||
|
||||
Set Width 1000
|
||||
Set Height 430
|
||||
Set Shell bash
|
||||
|
||||
Type "gum choose {1..5}"
|
||||
Sleep 500ms
|
||||
Enter
|
||||
Sleep 500ms
|
||||
Down@250ms 3
|
||||
Sleep 500ms
|
||||
Up@250ms 2
|
||||
Enter
|
||||
Sleep 1.5s
|
||||
Ctrl+L
|
||||
Sleep 500ms
|
||||
Type "gum choose --limit 2 Banana Cherry Orange"
|
||||
Sleep 500ms
|
||||
Enter
|
||||
Sleep 500ms
|
||||
Type@250ms "jxjxk"
|
||||
Sleep 1s
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
26
examples/confirm.tape
Normal file
26
examples/confirm.tape
Normal file
@ -0,0 +1,26 @@
|
||||
Output confirm.gif
|
||||
|
||||
Set Width 1000
|
||||
Set Height 350
|
||||
Set Shell bash
|
||||
|
||||
Sleep 500ms
|
||||
Type "gum confirm && echo 'Me too!' || echo 'Me neither.'"
|
||||
Sleep 1s
|
||||
Enter
|
||||
Sleep 1s
|
||||
Right
|
||||
Sleep 500ms
|
||||
Left
|
||||
Sleep 500ms
|
||||
Enter
|
||||
Sleep 1.5s
|
||||
Ctrl+L
|
||||
Type "gum confirm && echo 'Me too!' || echo 'Me neither.'"
|
||||
Sleep 500ms
|
||||
Enter
|
||||
Sleep 500ms
|
||||
Right
|
||||
Sleep 500ms
|
||||
Enter
|
||||
Sleep 1s
|
19
examples/customize.tape
Normal file
19
examples/customize.tape
Normal file
@ -0,0 +1,19 @@
|
||||
Output customize.gif
|
||||
|
||||
Set Width 1000
|
||||
Set Height 350
|
||||
Set Shell bash
|
||||
|
||||
Sleep 1s
|
||||
Type `gum input --cursor.foreground "#F4AC45" \` Enter
|
||||
Type `--prompt.foreground "#04B575" --prompt "What's up? " \` Enter
|
||||
Type `--placeholder "Not much, you?" --value "Not much, you?" \` Enter
|
||||
Type `--width 80` Enter
|
||||
Sleep 1s
|
||||
Ctrl+A
|
||||
Sleep 1s
|
||||
Ctrl+E
|
||||
Sleep 1s
|
||||
Ctrl+U
|
||||
Sleep 1s
|
||||
|
1
examples/fav.txt
Normal file
1
examples/fav.txt
Normal file
@ -0,0 +1 @@
|
||||
Banana
|
15
examples/file.tape
Normal file
15
examples/file.tape
Normal file
@ -0,0 +1,15 @@
|
||||
Output file.gif
|
||||
Set Width 800
|
||||
Set Height 525
|
||||
Set Shell bash
|
||||
|
||||
Type "gum file .."
|
||||
Enter
|
||||
Sleep 1s
|
||||
Down@150ms 6
|
||||
Sleep 1s
|
||||
Enter
|
||||
Sleep 1s
|
||||
Type "j"
|
||||
Sleep 1s
|
||||
|
4
examples/flavors.txt
Normal file
4
examples/flavors.txt
Normal file
@ -0,0 +1,4 @@
|
||||
Banana
|
||||
Cherry
|
||||
Orange
|
||||
Strawberry
|
12
examples/format.ansi
Normal file
12
examples/format.ansi
Normal file
@ -0,0 +1,12 @@
|
||||
[38;2;90;86;224m> [0mgum format -t code < main.go
|
||||
|
||||
|
||||
[38;5;204m[0m[38;5;252m[0m [38;5;252m [0m[38;5;252m [0m[38;5;204mpackage[0m[38;5;251m [0m[38;5;251mmain[0m[38;5;251m[0m
|
||||
[0m[38;5;252m[0m [38;5;252m [0m[38;5;252m [0m[38;5;251m[0m
|
||||
[0m[38;5;204m[0m[38;5;252m[0m [38;5;252m [0m[38;5;252m [0m[38;5;204mimport[0m[38;5;251m [0m[38;5;173m"fmt"[0m[38;5;251m[0m
|
||||
[0m[38;5;252m[0m [38;5;252m [0m[38;5;252m [0m[38;5;251m[0m
|
||||
[0m[38;5;39m[0m[38;5;252m[0m [38;5;252m [0m[38;5;252m [0m[38;5;39mfunc[0m[38;5;251m [0m[38;5;42mmain[0m[38;5;187m()[0m[38;5;251m [0m[38;5;187m{[0m[38;5;251m[0m
|
||||
[0m[38;5;252m[0m [38;5;252m [0m[38;5;252m [0m[38;5;251m [0m[38;5;251mfmt[0m[38;5;187m.[0m[38;5;42mPrintln[0m[38;5;187m([0m[38;5;173m"Charm_™ Gum"[0m[38;5;187m)[0m[38;5;251m[0m
|
||||
[0m[38;5;187m[0m[38;5;252m[0m [38;5;252m [0m[38;5;252m [0m[38;5;187m}[0m[38;5;251m[0m
|
||||
[0m[38;5;252m[0m [38;5;252m [0m[38;5;252m [0m[38;5;251m[0m
|
||||
[0m
|
16
examples/input.tape
Normal file
16
examples/input.tape
Normal file
@ -0,0 +1,16 @@
|
||||
Output input.gif
|
||||
|
||||
Set Width 800
|
||||
Set Height 250
|
||||
Set Shell bash
|
||||
|
||||
Sleep 1s
|
||||
Type `gum input --placeholder "What's up?"`
|
||||
Sleep 1s
|
||||
Enter
|
||||
Sleep 1s
|
||||
Type "Not much, you?"
|
||||
Sleep 1s
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
7
examples/main.go
Normal file
7
examples/main.go
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Charm_™ Gum")
|
||||
}
|
15
examples/pager.tape
Normal file
15
examples/pager.tape
Normal file
@ -0,0 +1,15 @@
|
||||
Output pager.gif
|
||||
|
||||
Set Shell bash
|
||||
Set Width 900
|
||||
Set Height 750
|
||||
|
||||
Sleep 1s
|
||||
Type "gum pager < README.md"
|
||||
Enter
|
||||
Sleep 1.5s
|
||||
Down@100ms 25
|
||||
Sleep 1s
|
||||
Up@100ms 25
|
||||
Sleep 3s
|
||||
|
13
examples/spin.tape
Normal file
13
examples/spin.tape
Normal file
@ -0,0 +1,13 @@
|
||||
Output spin.gif
|
||||
|
||||
Set Shell bash
|
||||
Set Width 1200
|
||||
Set Height 300
|
||||
Set FontSize 36
|
||||
|
||||
Sleep 500ms
|
||||
Type `gum spin --title "Buying Gum..." -- sleep 5`
|
||||
Sleep 1s
|
||||
Enter
|
||||
Sleep 4s
|
||||
|
2
examples/story.txt
Normal file
2
examples/story.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Once upon a time
|
||||
In a land far, far away....
|
21
examples/write.tape
Normal file
21
examples/write.tape
Normal file
@ -0,0 +1,21 @@
|
||||
Output write.gif
|
||||
|
||||
Set Width 800
|
||||
Set Height 350
|
||||
Set Shell bash
|
||||
|
||||
Sleep 500ms
|
||||
Type "gum write > story.txt"
|
||||
Enter
|
||||
Sleep 1s
|
||||
Type "Once upon a time"
|
||||
Sleep 1s
|
||||
Alt+Enter
|
||||
Type "In a land far, far away...."
|
||||
Sleep 500ms
|
||||
Enter
|
||||
Sleep 1s
|
||||
Type "cat story.txt"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
@ -14,7 +14,6 @@ import (
|
||||
// Run provides a shell script interface for the text input bubble.
|
||||
// https://github.com/charmbracelet/bubbles/textinput
|
||||
func (o Options) Run() error {
|
||||
|
||||
var value string
|
||||
if o.Value != "" {
|
||||
value = o.Value
|
||||
|
Loading…
Reference in New Issue
Block a user