Skip to content

Releases: charmbracelet/glamour

v0.10.0

16 Apr 19:49

Choose a tag to compare

Actually readable tables

Big tables that included links were always hard to read. Links can be very long, and tables often have limited space to render them. This means that links often took the space of many lines and weren't properly clickable because they were being truncated in practice.

Starting on this release, Glamour will render links and images at the footer of the table, with a reference number so you can easily find the link you're looking for. If you want the old behavior, it is still supported via the new WithInlineTableLinks option.

The New Way

table_with_footer_links_and_images

The Old Way

Wanna render tables with inline links? You still can:

r, err := glamour.NewTermRenderer(glamour.WithInlineTableLinks(true))
if err != nil { /*...*/ }

out, err := r.RenderBytes(in)
if err != nil { /*...*/ }

fmt.Fprintf(os.Stdout, "%s\n", out)

table_with_inline_links_and_images

Prettier GitHub links

We also introduced a change so that GitHub links inside tables that reference issues, discussions or PRs will be shown in its shortened form, similar to how GitHub itself present the links on issue descriptions: owner/repo#123.

table_with_footer_auto_links_short

Extra

Also, we introduced WithTableWrap, so you can disable table text wrapping if really want:

r, err := glamour.NewTermRenderer(glamour.WithTableWrap(false))
if err != nil { ... }

out, err := r.RenderBytes(in)
if err != nil { ... }

fmt.Fprintf(os.Stdout, "%s\n", out)

Changelog

New Features

Bug fixes

Other work


The Charm logo

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

v0.9.1

18 Mar 17:24
dddb9a7

Choose a tag to compare

Some users were reporting occasional checksum miss matches when building using Glamour v0.9.0.
This release provides a new tag to hopefully fix this.

Changelog

Other work

  • dddb9a7: ci: sync golangci-lint config (#403) (@github-actions[bot])

The Charm logo

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

v0.9.0

13 Mar 17:10
f43b1ad

Choose a tag to compare

Better Syntax Highlighting, Better Tables

It's totally time for a Glamour release right? This release features a nice lil' contribution from the @github CLI team and pulls in some big table improvements from Lip Gloss upstream. Let's go!

Specifying Chroma Styles

Thanks to valiant efforts of @andyfeller and @williammartin at @github, you can now use glamour.WithChromaFormatter to specify an exact Chroma style to use, independent of the higher level style.

myHotOps := glamour.WithOptions(
    glamour.WithChromaFormatter("terminal16"),
    glamour.WithStandardStyle("dark"),
)

As a bonus, you can also use glamour.WithOptions as a meta layer for grouping options.

Better Tables

This release also reaps the benefits from the table rendering overhaul in Lip Gloss v1.1.0! Glamour will now be much smarter when it comes to deciding column widths, and the content will now wrap appropriately instead of just being cut when it won't fit.

Changelog

New Features

Bug fixes

Documentation updates


The Charm logo

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

v0.8.0

05 Aug 17:56
29b800e

Choose a tag to compare

Fixing (almost) everything

With a ton of rendering fixes, she's sparkling ✨

It has that new car smell...

So many fixes…one man

@caarlos0 fixed a whopping 15 issues with PR #317 πŸ₯‡

  • Fix URL links not rendering inside bold text #312
  • Fix autolink element rendering #290
  • Add support for backslash escapes #106
  • Fix cases when backslash should not be shown #274
  • Fix escape character rendering #311
  • Fix newlines in definition lists #239
  • Fix nested blockquotes rendering #313
  • Fix block quote accidentally combining lines #237
  • Fix document-level indent causing unintended wrapping after quoted lines #68

Better tables

Tables now provide stable rendering of elements within the table including alignment, text styles, all that jazz. It now uses the lipgloss table, making it much more consistent across the board.

  • Render tables with Lip Gloss #262
  • Refactor to replace TableWriter with Lip Gloss table #254
  • Fix inline code within table #315
  • Fix links in tables #316
  • Provide consistent alignment of table elements #60
  • Support alignment in tables #117

New! Tokyo Night

The markdown renderer’s equivalent of a mani-pedi πŸ’…

Tokyo Night is now a built-in style for Glamour. This means you'll be able to use it in the next release of Glow.

glow -s "tokyo-night"
# OR
export GLAMOUR_STYLE="tokyo-night"

Tokyo Night x Glamour

Check out the custom style example to learn how to support custom styles in your own Glamour apps.

No TTY?

Glamour will now check if stdout is a tty and will strip styles when it is not.

Other Stuff

New Contributors

Full Changelog: v0.7.0...v0.8.0


The Charm logo

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


This discussion was created from the release v0.8.0.

v0.7.0

26 Mar 13:24
c271197

Choose a tag to compare

Fixes ’n’ Things

Fixed

Changes

New Contributors

Full Changelog: v0.6.0...v0.7.0


The Charm logo

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

v0.6.0

09 Nov 16:56

Choose a tag to compare

Pink theme and general maintenance

Fixed

Added

Changes

  • Bump github.com/muesli/termenv to 0.13.0
  • Bump github.com/yuin/goldmark to 1.5.2
  • Bump github.com/microcosm-cc/bluemonday to 1.0.21

New Contributors

Full Changelog: v0.5.0...v0.6.0


The Charm logo

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

v0.5.0

24 Jan 16:29
94148ad

Choose a tag to compare

Hello, Dracula

Added

  • Ship with built-in Dracula color scheme (#137)
package main

import (
        "fmt"
        "github.com/charmbracelet/glamour"
)

func main() {
        in := "# Hello World\n\nThis is a simple example of Markdown rendering with Glamour!"

        out, _ := glamour.Render(in, "dracula")
        fmt.Println(out)
}

v0.4.0

13 Jan 14:42

Choose a tag to compare

Fixed

  • Correctly render lists that don't start at 1 (#116)

Added

  • Optionally Preserving New Lines (#115)
  • Implement Capitalization (#118)
  • Added Dracula color scheme

Changes

  • Use goldmark v1.4.4
  • Use termenv v0.9.0
  • Use reflow v0.3.0
  • Use chroma v0.10.0
  • Use bluemonday v1.0.17

v0.3.0

09 Apr 15:57

Choose a tag to compare

Fixed

  • Read default styles before reading from the file system (#73)

Added

  • Add support for :emoji: (#92)

Changes

  • Use goldmark v1.3.3
  • Use termenv v0.8.1
  • Use reflow v0.2.0
  • Use chroma v0.8.2
  • Use bluemonday v1.0.6

v0.2.0

22 Jul 20:20
28b4a5c

Choose a tag to compare

Added

  • auto style automatically determines correct style for current terminal settings
  • Support for GLAMOUR_STYLE environment variable

Changes

  • Use goldmark v1.2.0
  • Use termenv v0.6.0 to detect terminal capabilities
  • Use chroma v0.7.3