alecthomas/chroma

A general purpose syntax highlighter in pure Go

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 10 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 13th, 2026
Created on June 7th, 2017
Open Issues & Pull Requests: 24 (+0)
GitHub issues: Enabled
Number of forks: 524
Total Stargazers: 5,039 (+0)
Total Subscribers: 25 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 63.3 days
Mean response time: 423.7 days
90th percentile: 1462.7 days
Tracked items: 159

Most active contributors

Sign in to see contributor activity.

How this project is maintained

Work labelled "feature request" is answered fastest, typically in about 24 hours, while "lexer missing" waits about 10 months. Three people close 100% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 3
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 789 days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • help wanted (63)
  • lexer missing (38)
  • bug (29)
  • feature request (26)
  • lexer bug (15)
  • lexer enhancement (12)
  • waiting (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Chroma is a general purpose syntax highlighter in pure Go that converts source code and structured text into syntax highlighted HTML, ANSI-coloured text, and other formats.

The tool addresses the need to transform raw source code into visually distinguished output by tokenizing input text and applying formatting rules. It works by identifying language-specific syntax patterns through lexers, then applying styles to produce formatted output. Chroma is based heavily on Pygments and includes translators for Pygments lexers and styles, allowing it to leverage an existing ecosystem of language definitions and color schemes.

Developers should choose Chroma when they need syntax highlighting as a library within Go applications or as a command-line tool. It suits projects that require flexible output formats beyond simple HTML, such as ANSI terminal coloring. The tool is particularly valuable for documentation generators, code review systems, and terminal-based applications where Go's single-binary deployment model is advantageous. Since Chroma is based on Pygments, developers familiar with that tool will recognize its architecture and capabilities.

The project maintains active development with ongoing refinement of its core API. A major version upgrade is in progress that modernizes the iterator interface to use Go's built-in iteration primitives rather than a custom type, reflecting attention to language evolution and API ergonomics. The codebase includes testing infrastructure for lexers, indicating commitment to correctness across supported languages. The project acknowledges gaps relative to Pygments and documents these limitations, showing transparency about its scope.