diff options
author | Maas Lalani <maas@lalani.dev> | 2024-04-05 04:16:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 04:16:25 -0400 |
commit | f75dfa668f7f43316b62871b4278f5863ea1c306 (patch) | |
tree | 63b5578f0e6ff38de6eeb12c8375e348293935df | |
parent | 2a3501932315f5f1a93e7ffc2672c361592eaf30 (diff) |
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
-rw-r--r-- | README.md | 26 | ||||
-rw-r--r-- | examples/.gitignore | 1 | ||||
-rw-r--r-- | examples/README.md | 36 | ||||
-rw-r--r-- | examples/choose.tape | 26 | ||||
-rw-r--r-- | examples/confirm.tape | 26 | ||||
-rw-r--r-- | examples/customize.tape | 19 | ||||
-rw-r--r-- | examples/fav.txt | 1 | ||||
-rw-r--r-- | examples/file.tape | 15 | ||||
-rw-r--r-- | examples/flavors.txt | 4 | ||||
-rw-r--r-- | examples/format.ansi | 12 | ||||
-rw-r--r-- | examples/input.tape | 16 | ||||
-rw-r--r-- | examples/main.go | 7 | ||||
-rw-r--r-- | examples/pager.tape | 15 | ||||
-rw-r--r-- | examples/spin.tape | 13 | ||||
-rw-r--r-- | examples/story.txt | 2 | ||||
-rw-r--r-- | examples/write.tape | 21 | ||||
-rw-r--r-- | input/command.go | 1 |
17 files changed, 227 insertions, 14 deletions
@@ -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 diff --git a/examples/.gitignore b/examples/.gitignore index 2d0c929..a8af5e2 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -1 +1,2 @@ *.gif +*.png diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..5200bac --- /dev/null +++ b/examples/README.md @@ -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 diff --git a/examples/choose.tape b/examples/choose.tape new file mode 100644 index 0000000..b09df07 --- /dev/null +++ b/examples/choose.tape @@ -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 + diff --git a/examples/confirm.tape b/examples/confirm.tape new file mode 100644 index 0000000..9cac1f0 --- /dev/null +++ b/examples/confirm.tape @@ -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 diff --git a/examples/customize.tape b/examples/customize.tape new file mode 100644 index 0000000..df307e8 --- /dev/null +++ b/examples/customize.tape @@ -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 + diff --git a/examples/fav.txt b/examples/fav.txt new file mode 100644 index 0000000..26182c7 --- /dev/null +++ b/examples/fav.txt @@ -0,0 +1 @@ +Banana diff --git a/examples/file.tape b/examples/file.tape new file mode 100644 index 0000000..43c68ff --- /dev/null +++ b/examples/file.tape @@ -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 + diff --git a/examples/flavors.txt b/examples/flavors.txt new file mode 100644 index 0000000..a436a92 --- /dev/null +++ b/examples/flavors.txt @@ -0,0 +1,4 @@ +Banana +Cherry +Orange +Strawberry diff --git a/examples/format.ansi b/examples/format.ansi new file mode 100644 index 0000000..b739238 --- /dev/null +++ b/examples/format.ansi @@ -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 diff --git a/examples/input.tape b/examples/input.tape new file mode 100644 index 0000000..aceb49e --- /dev/null +++ b/examples/input.tape @@ -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 + diff --git a/examples/main.go b/examples/main.go new file mode 100644 index 0000000..bdabe9e --- /dev/null +++ b/examples/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Charm_™ Gum") +} diff --git a/examples/pager.tape b/examples/pager.tape new file mode 100644 index 0000000..aff6b92 --- /dev/null +++ b/examples/pager.tape @@ -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 + diff --git a/examples/spin.tape b/examples/spin.tape new file mode 100644 index 0000000..1f92e22 --- /dev/null +++ b/examples/spin.tape @@ -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 + diff --git a/examples/story.txt b/examples/story.txt new file mode 100644 index 0000000..c5a3c85 --- /dev/null +++ b/examples/story.txt @@ -0,0 +1,2 @@ +Once upon a time +In a land far, far away.... diff --git a/examples/write.tape b/examples/write.tape new file mode 100644 index 0000000..8328555 --- /dev/null +++ b/examples/write.tape @@ -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 + diff --git a/input/command.go b/input/command.go index 17f38ff..c02f65c 100644 --- a/input/command.go +++ b/input/command.go @@ -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 |