docs: fix typos and clean up comments
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Glenn Gonda · committed by Christian Rocha · parent 76c3c1a · Browse files · 9 files·+12 added−12 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+12 added−12 removed
- other:+12 added−12 removed
Provenance
- Commit
4880cf2- Tree
4551d71- Author
Glenn Gonda <alohaglenn@icloud.com>- Committer
Christian Rocha <christian@rocha.is>- Parent
76c3c1a
9 files changed+12 added−12 removed
modified:examples/credit-card-form/main.go+1 added-1 removed
69 unmodified lines70 }71 72 func expValidator(s string) error {73 // The 3 character should be a slash (/)74- // The rest thould be numbers74+ // The rest should be numbers75 e := strings.ReplaceAll(s, "/", "")76 _, err := strconv.ParseInt(e, 10, 64)77 if err != nil {78 return fmt.Errorf("EXP is invalid")123 unmodified linesmodified:examples/help/main.go+1 added-1 removed
85 unmodified lines86 87 func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {88 switch msg := msg.(type) {89 case tea.WindowSizeMsg:90- // If we set a width on the help menu it can it can gracefully truncate90+ // If we set a width on the help menu it can gracefully truncate91 // its view as needed.92 m.help.Width = msg.Width93 94 case tea.KeyMsg:53 unmodified linesmodified:examples/simple/main.go+1 added-1 removed
54 unmodified lines55 }56 return m, nil57 }58 59-// Views return a string based on data in the model. That string which will be59+// View returns a string based on data in the model. That string which will be60 // rendered to the terminal.61 func (m model) View() string {62 return fmt.Sprintf("Hi. This program will exit in %d seconds. To quit sooner press any key.\n", m)63 }9 unmodified linesmodified:examples/textarea/main.go+1 added-1 removed
1 package main2 3-// A simple program demonstrating the text input component from the Bubbles3+// A simple program demonstrating the textarea component from the Bubbles4 // component library.5 6 import (7 "fmt"74 unmodified linesmodified:examples/tui-daemon-combo/main.go+1 added-1 removed
121 unmodified lines122 123 return indent.String(s, 1)124 }125 126-// processFinishedMsg is send when a pretend process completes.126+// processFinishedMsg is sent when a pretend process completes.127 type processFinishedMsg time.Duration128 129 // pretendProcess simulates a long-running process.130 func runPretendProcess() tea.Msg {9 unmodified linesmodified:tutorials/basics/main.go+1 added-1 removed
16 unmodified lines17 return model{18 choices: []string{"Buy carrots", "Buy celery", "Buy kohlrabi"},19 20 // A map which indicates which choices are selected. We're using21- // the map like a mathematical set. The keys refer to the indexes21+ // the map like a mathematical set. The keys refer to the indexes22 // of the `choices` slice, above.23 selected: make(map[int]struct{}),24 }25 }61 unmodified linesmodified:tutorials/basics/README.md+2 added-2 removed
62 unmodified lines63 // Our to-do list is a grocery list64 choices: []string{"Buy carrots", "Buy celery", "Buy kohlrabi"},65 66 // A map which indicates which choices are selected. We're using67- // the map like a mathematical set. The keys refer to the indexes67+ // the map like a mathematical set. The keys refer to the indexes68 // of the `choices` slice, above.69 selected: make(map[int]struct{}),70 }71 }81 unmodified lines153 ## The View Method154 155 At last, it’s time to render our UI. Of all the methods, the view is the156 simplest. We look at the model in its current state and use it to return157-a `string`. That string is our UI!157+a `string`. That string is our UI!158 159 Because the view describes the entire UI of your application, you don’t have to160 worry about redrawing logic and stuff like that. Bubble Tea takes care of it161 for you.81 unmodified linesmodified:mouse.go+2 added-2 removed
3 unmodified lines4 "bytes"5 "errors"6 )7 8-// MouseMsg contains information about a mouse event and are sent to a programs8+// MouseMsg contains information about a mouse event and is sent to a program's9 // update function when mouse activity occurs. Note that the mouse must first10-// be enabled via in order the mouse events to be received.10+// be enabled in order for the mouse events to be received.11 type MouseMsg MouseEvent12 13 // MouseEvent represents a mouse event, which could be a click, a scroll wheel14 // movement, a cursor movement, or a combination.135 unmodified linesmodified:options.go+2 added-2 removed
39 unmodified lines40 p.startupOptions |= withCustomInput41 }42 }43 44-// WithInputTTY open a new TTY for input (or console input device on Windows).44+// WithInputTTY opens a new TTY for input (or console input device on Windows).45 func WithInputTTY() ProgramOption {46 return func(p *Program) {47 p.startupOptions |= withInputTTY48 }94 unmodified lines143 144 // WithANSICompressor removes redundant ANSI sequences to produce potentially145 // smaller output, at the cost of some processing overhead.146 //147-// This feature is provisional, and may be changed removed in a future version147+// This feature is provisional, and may be changed or removed in a future version148 // of this package.149 func WithANSICompressor() ProgramOption {150 return func(p *Program) {151 p.startupOptions |= withANSICompressor2 unmodified lines