Skip to content
Myr

README.md

This file

Path

format/README.md

84 lines · 2.3 KiB · Markdown

Last changed by

docs(format): add table exampleCarlos Alexandro Beckerbefore adoptionb58aad1

History of this file

Take it

The walk stopped after 200 commits: lines older than 6837ed2 point at it.

feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2

lines 1–9why, one step back
1# Gum Format
23Gum format allows you to format different text into human readable output.45Four different parse-able formats exist:671. [Markdown](#markdown)82. [Code](#code)93. [Template](#template)

docs(format): add table exampleCarlos Alexandro Beckerbefore adoptionb58aad1

line 10why, one step back
104. [Emoji](#emoji)

feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2

lines 11–45why, one step back
11
12## Markdown1314Render any input as markdown text. This uses15[Glamour](https://github.com/charmbracelet/glamour) behind the scenes.1617You can pass input as lines directly as arguments to the command invocation or18pass markdown over `stdin`.1920```bash21gum format --type markdown < README.md22# Or, directly as arguments (useful for quick lists)23gum format --type markdown -- "# Gum Formats" "- Markdown" "- Code" "- Template" "- Emoji"24```2526## Code2728Render any code snippet with syntax highlighting.29[Glamour](https://github.com/charmbracelet/glamour), which uses30[Chroma](https://github.com/alecthomas/chroma) under the hood, handles styling.3132Similarly to the `markdown` format, `code` can take input over `stdin`.3334```bash35cat options.go | gum format --type code36```3738## Template3940Render styled input from a string template. Templating is handled by41[Termenv](https://github.com/muesli/termenv).4243```bash44gum format --type template '{{ Bold "Tasty" }} {{ Italic "Bubble" }} {{ Color "99" "0" " Gum " }}'45# Or, via stdin

docs(format): add table exampleCarlos Alexandro Beckerbefore adoptionb58aad1

line 46why, one step back
46echo '{{ Bold "Tasty" }} {{ Italic "Bubble" }} {{ Color "99" "0" " Gum " }}' | gum format --type template

feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2

lines 47–57why, one step back
47```
4849## Emoji5051Parse and render emojis from their matching `:name:`s. Powered by52[Glamour](https://github.com/charmbracelet/glamour) and [Goldmark53Emoji](https://github.com/yuin/goldmark-emoji)5455```bash56gum format --type emoji 'I :heart: Bubble Gum :candy:'57# You know the drill, also via stdin

docs(format): add table exampleCarlos Alexandro Beckerbefore adoptionb58aad1

line 58why, one step back
58echo 'I :heart: Bubble Gum :candy:' | gum format --type emoji

feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2

line 59why, one step back
59```

docs(format): add table exampleCarlos Alexandro Beckerbefore adoptionb58aad1

lines 60–84why, one step back
60
61## Tables6263Tables are rendered using [Glamour](https://github.com/charmbracelet/glamour).6465| Bubble Gum Flavor | Price |66| ----------------- | ----- |67| Strawberry | $0.99 |68| Cherry | $0.50 |69| Banana | $0.75 |70| Orange | $0.25 |71| Lemon | $0.50 |72| Lime | $0.50 |73| Grape | $0.50 |74| Watermelon | $0.50 |75| Pineapple | $0.50 |76| Blueberry | $0.50 |77| Raspberry | $0.50 |78| Cranberry | $0.50 |79| Peach | $0.50 |80| Apple | $0.50 |81| Mango | $0.50 |82| Pomegranate | $0.50 |83| Coconut | $0.50 |84| Cinnamon | $0.50 |