Download Latest Version v0.10.0 source code.tar.gz (69.5 kB)
Email in envelope

Get an email when there's a new version of Glamour

Home / v0.10.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-04-16 3.7 kB
v0.10.0 source code.tar.gz 2025-04-16 69.5 kB
v0.10.0 source code.zip 2025-04-16 139.9 kB
Totals: 3 Items   213.0 kB 0

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:

:::go
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:

:::go
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

  • 61cfc45c6bcd582a4d0ca810690d668f276ede13: feat(table): add ability to render links at the bottom (@andreynering)
  • 9d873734c11cf9d1e29853643a751624042df3b0: feat(table): pad position on table link list (@andreynering)
  • 42f47a22f34bbbf73421210e7aff4f6438ffd052: feat(table): prefix all links with the position in the footer (@andreynering)
  • a11e9a0c3a66a55d411a0aa4dcd6685d4ba9d823: feat(table): show position of link also inside the table (@andreynering)
  • 549f544650e38ad6f4ed21cf79e3749d7c08a7f5: feat(table): update lipgloss + add WithTableWrap setting (@andreynering)
  • c9af0458d403e584402ff683e0e8403a194d73d3: feat(tables): format github links inside tables in a more readable manner (@andreynering)
  • f2eb484a992f6a31bad968205b6d63719b8c7fa2: feat: add autolink package with patterns for more readable github urls (@andreynering)

Bug fixes

  • 61ff598982b5f63f39c6d25f96b9ae9147dc1f74: fix(links): fix regression of auto links rendering twice (#415) (@andreynering)
  • 6c48e0972a9700f7b0b7f855712cfe114c071ae3: fix: address linting issues after golangci-lint v2 update (@andreynering)
  • 5437e4a1a7dfc095a4afe063feaab079ab5a9629: fix: ensure that prop is always cleared (@andreynering)

Other work

  • 6b099168a251abc878bf7ca325c8f688cd471b87: ci: sync golangci-lint config (#414) (@github-actions[bot])
  • 9dfd8659d989dbd2dafd235eb370aa05b126fd35: lint: fix linting for unused parameter (@andreynering)

The Charm logo

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

Source: README.md, updated 2025-04-16