rouge-ruby/rouge

A pure Ruby code highlighter that is compatible with Pygments

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 11 minutes ago
Added to GitGenius on September 20th, 2026
Created on August 31st, 2012
Open Issues & Pull Requests: 222 (+0)
GitHub issues: Enabled
Number of forks: 816
Total Stargazers: 3,450 (+0)
Total Subscribers: 50 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 39
New in 7 days: 2
Closed in 7 days: 0
Avg open age: 577 days
Stale 30+ days: 36
Stale 90+ days: 31

Recent activity

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

Top labels

  • bugfix-request (42)
  • lexer-request (23)
  • enhancement-request (6)
  • pr-open (6)
  • docs-request (3)
  • feature (2)
  • stale-issue (2)

Detailed Description

Rouge is a pure Ruby syntax highlighter that can output HTML or ANSI 256-color text and is compatible with Pygments stylesheets.

The tool solves the problem of syntax highlighting code snippets in Ruby applications without external dependencies. It works by parsing source code and tokenizing it according to language-specific lexers, then applying formatting rules to produce colored output. The approach is language-agnostic, supporting over two hundred different languages through individual lexer implementations.

Rouge suits projects that need syntax highlighting as a library component, particularly those already using Ruby. It integrates directly into Jekyll as the default syntax highlighter and can be used as a command-line tool via the rougify command. The tool's Pygments compatibility means existing stylesheets designed for Pygments can be reused without modification. Developers should choose it when they want to avoid external highlighter dependencies or need fine-grained control over output formatting through custom formatters.

The project maintains active development with regular updates to language support and formatter options. The codebase uses standard Ruby testing and linting practices to ensure code quality. The tool provides multiple built-in formatters for different use cases, from simple HTML class-based styling to complex table layouts with line numbering and highlighting, allowing users to extend functionality through custom formatter implementations.