Skip to content

docs: add v2 upgrade guide + release notes#509

Open
aymanbagabas wants to merge 1 commit intov2-expfrom
charm-1225-whats-new-and-upgrade-guide
Open

docs: add v2 upgrade guide + release notes#509
aymanbagabas wants to merge 1 commit intov2-expfrom
charm-1225-whats-new-and-upgrade-guide

Conversation

@aymanbagabas
Copy link
Member

@aymanbagabas aymanbagabas commented Mar 3, 2026

Add v2 upgrade guide

Release notes

What's New in Glamour v2

We're excited to announce the second major release of Glamour!

[!NOTE]
We don't take API changes lightly and strive to make the upgrade process as simple as possible. We believe these changes bring necessary improvements and pave the way for the future. If something feels way off, let us know.

❤️ Charm Land Import Path

We've updated our import paths to use vanity domains and use our domain to import Go packages.

// Before
import "github.com/charmbracelet/glamour"

// After
import "charm.land/glamour/v2"

💄 Lip Gloss v2 Integration

Glamour v2 now uses Lip Gloss v2 under the hood, bringing improved performance and more consistent styling across the Charm ecosystem.

Since Glamour is designed to be pure (same input = same output), it doesn't peek at your terminal's capabilities. Instead, color downsampling is handled explicitly via Lip Gloss when you're ready to render:

r, _ := glamour.NewTermRenderer(glamour.WithWordWrap(80))
out, _ := r.Render(markdown)

// Downsample colors based on terminal capabilities
lipgloss.Print(out)

No more I/O fights between Glamour and Lip Gloss. Glamour focuses on rendering, Lip Gloss handles the colors. Everyone's happy!

🌏 Better Text Wrapping

Text wrapping has been rewritten using lipgloss.Wrap, which means way better handling of:

  • Multi-byte UTF-8 characters (CJK, emojis, etc.)
  • Complex Unicode sequences
  • Terminal cell width edge cases

Your Japanese documentation, emoji-filled READMEs, and creative Unicode art will all render beautifully now.

🔗 Hyperlink Support

Glamour now supports ANSI hyperlinks! If your terminal supports OSC 8 (and many modern terminals do), your links can be clickable. No changes needed, it just works.

md := `Check out [Charm](https://charm.sh) for more awesome tools!`
out, _ := glamour.Render(md, "dark")
fmt.Print(out)
// In supporting terminals, "Charm" will be clickable!
Which terminals support OSC 8 hyperlinks?

📧 Cleaner Email Rendering

Email autolinks now hide the mailto: prefix for a cleaner look while remaining functional. Because nobody wants to read mailto: in their rendered markdown.

// Before (v1): Rendered as "mailto:hello@charm.sh"
md := `Contact us at <hello@charm.sh>`
out, _ := glamour.Render(md, "dark")
// Output: mailto:hello@charm.sh (ugly!)

// After (v2): Rendered as just "hello@charm.sh"
md := `Contact us at <hello@charm.sh>`
out, _ := glamour.Render(md, "dark")
// Output: hello@charm.sh (much better!)

🌙 Dark is the New Default

The WithAutoStyle() option and AutoStyle have been removed. The default style is now "dark", which works well across most terminals. You can still explicitly choose any style:

// Use a specific style
out, _ := glamour.Render(markdown, "light")
out, _ := glamour.Render(markdown, "pink")
out, _ := glamour.Render(markdown, "dracula")
out, _ := glamour.Render(markdown, "tokyo-night")

Simpler is better!

🎨 Color Profile Changes

The WithColorProfile() option has been removed. Color adaptation is now handled by Lip Gloss when rendering output:

// Old approach (v1)
r, _ := glamour.NewTermRenderer(
    glamour.WithColorProfile(termenv.TrueColor),
)

// New approach (v2)
r, _ := glamour.NewTermRenderer(glamour.WithWordWrap(80))
out, _ := r.Render(markdown)
lipgloss.Print(out) // Handles color downsampling automatically

This separation of concerns makes Glamour's rendering more predictable and testable.

👋 Farewell, Overline

The Overlined field has been removed from all style primitives. It was rarely used and not widely supported across terminals. If you need similar visual separation, consider using underline, bold, or background colors instead.

🐛 Bug Fixes

  • Fixed CJK character rendering in margin writers
  • Fixed table background colors to match document styling
  • Improved handling of edge cases in text wrapping
  • Better handling of code spans with special characters

Feedback

Have thoughts on Glamour v2? We'd love to hear about it. Let us know on…


Part of Charm.

The Charm logo

Charm热爱开源 • Charm loves open source

@aymanbagabas aymanbagabas requested a review from caarlos0 as a code owner March 3, 2026 11:54
@aymanbagabas aymanbagabas changed the title docs: add v2 upgrade guide docs: add v2 upgrade guide + release notes Mar 3, 2026
@aymanbagabas aymanbagabas changed the title docs: add v2 upgrade guide + release notes docs: add v2 upgrade guide Mar 3, 2026
@aymanbagabas aymanbagabas changed the title docs: add v2 upgrade guide docs: add v2 upgrade guide + release notes Mar 3, 2026
## Update Dependencies

```bash
go get charm.land/glamour/v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
go get charm.land/glamour/v2
go get charm.land/glamour/v2@latest

If you need color downsampling (most apps do):

```bash
go get charm.land/lipgloss/v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
go get charm.land/lipgloss/v2
go get charm.land/lipgloss/v2@latest

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.

2 participants