Rouge VS Highlight.js

Compare Rouge vs Highlight.js and see what are their differences.

Rouge

A pure Ruby code highlighter that is compatible with Pygments (by rouge-ruby)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
Rouge Highlight.js
5 83
3,276 23,026
0.1% 0.8%
7.6 8.7
9 days ago 10 days ago
Ruby JavaScript
GNU General Public License v3.0 or later BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

Rouge

Posts with mentions or reviews of Rouge. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-08-21.
  • Simple Dev.to Article Improvements
    3 projects | dev.to | 21 Aug 2023
    To see if a particular language is supported you can use Rouge's handle tool rougify. First install a ruby interpreter. Then checkout the rouge source code and run bin/rougify list in the source code root directory:
  • Doesn't anybody use -w?
    1 project | /r/ruby | 20 Apr 2023
    But... it seems like so many programs were written without this rudimentary check on. Consider this example. I installed Rouge, the well regarded syntax highlighter. Here's some basic code, almost copied directly from their github page:
  • Rouge syntax highlighter removes support for Solidity “pyramid scheme”
    1 project | news.ycombinator.com | 6 Sep 2022
  • Syntax highlighting library support for modern frontend frameworks
    2 projects | dev.to | 22 Jun 2022
    I was going to write a post about Svelte and I was checking if it is a language that is supported by the highlighting library I use (Rouge). It is not! I guess I could fudge it by using HTML as the language for the code blocks because it is HTML-like. Or add a lexer/extension myself! 🤔
  • Glimmer DSL for LibUI Code Area (Ruby Tooling Future)
    2 projects | dev.to | 26 Mar 2022
    Brandon Weaver has recently contacted me on the Glimmer Gitter to ask questions about Glimmer DSL for LibUI. He also mentioned the node pattern tool written by Marc-André Lafortune (a fellow Rubyist I know in Montreal), which is hosted on Heroku. Brandon said he was excited about the possibility of implementing something similar in pure Ruby using Glimmer DSL for LibUI by leveraging the rouge syntax highlighting gem. He has even blogged about the Ruby Tooling subject in the past with the title "Future of Ruby - AST Tooling", which Matz (creator of Ruby) has alluded to before.

Highlight.js

Posts with mentions or reviews of Highlight.js. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-08.
  • Vala Programming Language
    14 projects | news.ycombinator.com | 8 Apr 2024
    > it was designed to resemble C#

    I actually first heard of Vala just a few days ago when I was looking at a C#-related PR[1] for highlight.js:

    > This fails the tests as the Vala default.txt is recognized now as C#. However, Vala is very close in syntax to C#, and the default.txt also seems to be valid C# so not sure what to do about this.

    [1] https://github.com/highlightjs/highlight.js/pull/3906

  • Dev.to and GitHub usage pl Syntax Highlighter
    1 project | dev.to | 17 Mar 2024
    About GitHub Source - https://github.com/highlightjs/highlight.js/issues/1224
  • Code Syntax highlighting in Next Js
    1 project | dev.to | 15 Jan 2024
    Let's get started by installing the highlight js
  • Build a simple code editor
    2 projects | dev.to | 25 Dec 2023
    Luckily, implementing syntax highlighting in our simple code editor is easy with the use of external libraries. There are several JavaScript libraries available, such as Prism and Highlight.js. For our editor, we'll use Prism since it's easy to use and supports a wide range of programming languages.
  • We're Not a CDN – Highlight.js
    1 project | news.ycombinator.com | 18 Dec 2023
    They do actually document the recommended path in their GitHub docs: https://github.com/highlightjs/highlight.js#GettingTheLibrar...
  • Show HN: A template for Markdown-based sites (no static site generator required)
    3 projects | news.ycombinator.com | 3 Dec 2023
    The templates grabs Markdown file data with XMLHttpRequest and converts it to HTML with https://showdownjs.com/ . Classless styles are done with https://picocss.com/ and code block syntax highlighting is done with https://highlightjs.org/ .

    GitHub repo: https://github.com/dandalpiaz/markdown-pages

  • Is copying from open source projects stealing?
    3 projects | dev.to | 31 Oct 2023
    My search for a third-party syntax highlighter brought me to highlight.js. ctil converts text (.txt) and Markdown (.md) to generated HTML (.html) files, so I want the generated HTML files to support syntax highlighting. highlight.js can be used as HTML Tags by using a Content Delivery Network, CDN, so I was able to add highlight.js by adding the following lines to the generated HTML files:
  • building a basic markdown editor: unified, trees and data
    2 projects | dev.to | 2 Oct 2023
    The real magic is what happens once you generate the syntax trees; at that point, you can modify them with the existing plugins (or make you own, if you really want to). For instance, I use a plugin to add specific css classes to certain elements so they integrate better with the visual design of the website another to add code highlighting with highlight.js and some others for generating a js object from the frontmatter of a Markdown file and to add support for Github flavored Markdown. I could do a lot more with these, like add support for videos, embeds and more, but for now this is enough for a simple preview.
  • HTML5 - Text markup elements
    1 project | dev.to | 14 Sep 2023
    pre is for a block of preformatted text, so spaces are preserved, and the font can be monospaced. Another element is code for programming codes. Notice that code doesn't offer code highlighting; for this, use JavaScript + CSS code, like Highlight.js.
  • Scraping Google Maps
    2 projects | /r/node | 11 Jun 2023

What are some alternatives?

When comparing Rouge and Highlight.js you can also consider the following projects:

CodeRay - Fast and easy syntax highlighting for selected languages, written in Ruby.

PrismJS - Lightweight, robust, elegant syntax highlighting.

pygments.rb - 💎 Ruby wrapper for Pygments syntax highlighter

Pygments

Javascript Left-Right Parser - Parser for JavaScript

Gollum - A simple, Git-powered wiki with a local frontend and support for many kinds of markup and content.

tiptap - The headless rich text editor framework for web artisans.

linguist - Language Savant. If your repository's language is being reported incorrectly, send us a pull request!

quill - Quill is a modern WYSIWYG editor built for compatibility and extensibility.

kotlin-latex-listing - A syntax highlighting template for the Kotlin language in LaTeX listings.