Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update module github.com/charmbracelet/lipgloss to v0.9.1 #131

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

ctison
Copy link
Owner

@ctison ctison commented Aug 23, 2023

This PR contains the following updates:

Package Type Update Change
github.com/charmbracelet/lipgloss require minor v0.7.1 -> v0.9.1

Warning

Some dependencies could not be looked up. Check the warning logs for more information.


Release Notes

charmbracelet/lipgloss (github.com/charmbracelet/lipgloss)

v0.9.1

Compare Source

This bugfix release changes the Table Headers API to accept []string for consistency with Row / Rows and downgrades Lip Gloss to Go version v1.17.

What's Changed

Full Changelog: charmbracelet/lipgloss@v0.9.0...v0.9.1

v0.9.0

Compare Source

My, how the tables have turned

Now you can draw Tables with Lip Gloss! 💅

image

View the source code.

Let's get started

import "github.com/charmbracelet/lipgloss/table"

Define some rows of data.

rows := [][]string{
    {"Chinese", "您好", "你好"},
    {"Japanese", "こんにちは", "やあ"},
    {"Arabic", "أهلين", "أهلا"},
    {"Russian", "Здравствуйте", "Привет"},
    {"Spanish", "Hola", "¿Qué tal?"},
}

Use the table package to style and render the table.

t := table.New().
    Border(lipgloss.NormalBorder()).
    BorderStyle(lipgloss.NewStyle().Foreground(lipgloss.Color("99"))).
    StyleFunc(func(row, col int) lipgloss.Style {
        switch {
        case row == 0:
            return HeaderStyle
        case row%2 == 0:
            return EvenRowStyle
        default:
            return OddRowStyle
        }
    }).
    Headers("LANGUAGE", "FORMAL", "INFORMAL").
    Rows(rows...)

// You can also add tables row-by-row
t.Row("English", "You look absolutely fabulous.", "How's it going?")

Print the table.

fmt.Println(t)
Table example

For more on tables see the examples.

Additional Borders

Lip Gloss' Border now supports additional middle border separators.

type Border struct {
    // ...
    MiddleLeft   string
    MiddleRight  string
    Middle       string
    MiddleTop    string
    MiddleBottom string
}

v0.8.0

Compare Source

Predictable Tabs

At last: tabs that render the way you want ’em to. With the new Style.TabWidth() method, you can determine exactly how a \t will render.

Before this release, Lip Gloss used to mis-measure a tab (i.e. a \t) at 0 cells wide when they actually render at different widths in different terminals (usually 8 cells, sometimes 4 cells). For these reasons, tabs are almost never what you want when designing layouts for TUIs.

With this release, a tab will get converted to 4 spaces by default—so this is a behavioral change—but you can customize the behavior as well as disable it entirely.

s := lipgloss.NewStyle()        // 4 spaces per tab, the default
s = s.TabWidth(2)               // 2 spaces per tab
s = s.TabWidth(0)               // remove tabs
s = s.TabWidth(-1)              // don't convert tabs to spaces
s = s.TabWidth(NoTabConversion) // alias of the above

You can disable the feature with Style.TabWidth(NoTabConversion) (or Style.TabWidth(-1), if you're the pedantic type).

Bug Fixes

This release also includes a bunch of bug fixes. This includes:


Full Changelog: charmbracelet/lipgloss@v0.7.1...v0.8.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@ctison ctison self-assigned this Aug 23, 2023
@ctison ctison force-pushed the renovate/github.com-charmbracelet-lipgloss-0.x branch from c2ddcf6 to e6388a7 Compare October 11, 2023 06:02
@ctison ctison changed the title chore(deps): update module github.com/charmbracelet/lipgloss to v0.8.0 chore(deps): update module github.com/charmbracelet/lipgloss to v0.9.0 Oct 11, 2023
@ctison ctison changed the title chore(deps): update module github.com/charmbracelet/lipgloss to v0.9.0 chore(deps): update module github.com/charmbracelet/lipgloss to v0.9.1 Oct 12, 2023
@ctison ctison force-pushed the renovate/github.com-charmbracelet-lipgloss-0.x branch from e6388a7 to 60ebfb5 Compare October 12, 2023 06:02
@ctison ctison merged commit fbf9a75 into main Oct 13, 2023
1 check passed
@ctison ctison deleted the renovate/github.com-charmbracelet-lipgloss-0.x branch October 13, 2023 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants