mirror of
https://github.com/charmbracelet/gum
synced 2024-06-04 06:42:23 +02:00
docs: style
and join
screenshots
This commit is contained in:
parent
7907c40005
commit
a26995e17f
40
README.md
40
README.md
|
@ -164,23 +164,12 @@ Pretty print any string with any layout with one command.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gum style \
|
gum style \
|
||||||
--foreground "#FF06B7" --border "double" --align "center" \
|
--foreground 212 --border-foreground 212 --border double \
|
||||||
--width 50 --margin "1 2" --padding "2 4" \
|
--align center --width 50 --margin "1 2" --padding "2 4" \
|
||||||
"Bubble Gum (1¢)" "So sweet and so fresh\!"
|
'Bubble Gum (1¢)' 'So sweet and so fresh!'
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
<img src="https://stuff.charm.sh/gum/style.png?cache=1" width="600" alt="Bubble Gum, So sweet and so fresh!">
|
||||||
|
|
||||||
╔══════════════════════════════════════════════════╗
|
|
||||||
║ ║
|
|
||||||
║ ║
|
|
||||||
║ Bubble Gum (1¢) ║
|
|
||||||
║ So sweet and so fresh! ║
|
|
||||||
║ ║
|
|
||||||
║ ║
|
|
||||||
╚══════════════════════════════════════════════════╝
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Join
|
#### Join
|
||||||
|
|
||||||
|
@ -191,28 +180,17 @@ Note: It's important to wrap the output of `gum style` in quotes to ensure new
|
||||||
lines (`\n`) are part of a single argument passed to the `join` command.
|
lines (`\n`) are part of a single argument passed to the `join` command.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
I=$(gum style --padding "1 5" --border double "I")
|
I=$(gum style --padding "1 5" --border double --border-foreground 212 "I")
|
||||||
LOVE=$(gum style --padding "1 4" --border double "LOVE")
|
LOVE=$(gum style --padding "1 4" --border double --border-foreground 57 "LOVE")
|
||||||
BUBBLE=$(gum style --padding "1 8" --border double "Bubble")
|
BUBBLE=$(gum style --padding "1 8" --border double --border-foreground 255 "Bubble")
|
||||||
GUM=$(gum style --padding "1 5" --border double "Gum")
|
GUM=$(gum style --padding "1 5" --border double --border-foreground 240 "Gum")
|
||||||
|
|
||||||
I_LOVE=$(gum join "$I" "$LOVE")
|
I_LOVE=$(gum join "$I" "$LOVE")
|
||||||
BUBBLE_GUM=$(gum join "$BUBBLE" "$GUM")
|
BUBBLE_GUM=$(gum join "$BUBBLE" "$GUM")
|
||||||
gum join --align center --vertical "$I_LOVE" "$BUBBLE_GUM"
|
gum join --align center --vertical "$I_LOVE" "$BUBBLE_GUM"
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
<img src="https://stuff.charm.sh/gum/join.png" width="600" alt="I LOVE Bubble Gum written out in four boxes with double borders around them.">
|
||||||
╔═══════════╗╔════════════╗
|
|
||||||
║ ║║ ║
|
|
||||||
║ I ║║ LOVE ║
|
|
||||||
║ ║║ ║
|
|
||||||
╚═══════════╝╚════════════╝
|
|
||||||
╔══════════════════════╗╔═════════════╗
|
|
||||||
║ ║║ ║
|
|
||||||
║ Bubble ║║ Gum ║
|
|
||||||
║ ║║ ║
|
|
||||||
╚══════════════════════╝╚═════════════╝
|
|
||||||
```
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue