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

fix(deps): update module github.com/charmbracelet/lipgloss to v0.10.0 #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 13, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
github.com/charmbracelet/lipgloss v0.8.0 -> v0.10.0 age adoption passing confidence

Release Notes

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

v0.10.0

Compare Source

String Transforms 💄

Lip Gloss v0.10.0 features a brand new Transform function for Styles to alter strings at render time. As well as some bug fixes, like ANSI-aware table cell truncation. 🧹

Simply define a Transform function as func (string) string and apply it to any style:

// Example:
s := NewStyle().Transform(strings.ToUpper)
fmt.Println(s.Render("raow!") // "RAOW!"

Or, if you prefer:

// Example:
reverse := func(s string) string {
    n := 0
    rune := make([]rune, len(s))
    for _, r := range s {
        rune[n] = r
	n++
    }
    rune = rune[0:n]
    for i := 0; i < n/2; i++ {
        rune[i], rune[n-1-i] = rune[n-1-i], rune[i]
    }
    return string(rune)
}

s := NewStyle().Transform(reverse)
fmt.Println(s.Render("The quick brown 狐 jumped over the lazy 犬")
// "犬 yzal eht revo depmuj 狐 nworb kciuq ehT",

What's Changed?

New Contributors

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


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Slack.

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
}

Configuration

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

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

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 Mend Renovate. View repository job log here.

@renovate renovate bot changed the title fix(deps): update module github.com/charmbracelet/lipgloss to v0.9.0 fix(deps): update module github.com/charmbracelet/lipgloss to v0.9.1 Oct 15, 2023
@renovate renovate bot force-pushed the renovate/github.com-charmbracelet-lipgloss-0.x branch from 40748b7 to 8b12464 Compare October 15, 2023 06:07
@renovate renovate bot force-pushed the renovate/github.com-charmbracelet-lipgloss-0.x branch from 8b12464 to 0d9fbd5 Compare March 8, 2024 16:20
@renovate renovate bot changed the title fix(deps): update module github.com/charmbracelet/lipgloss to v0.9.1 fix(deps): update module github.com/charmbracelet/lipgloss to v0.10.0 Mar 8, 2024
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

0 participants