Jekyll One

Rouge is a pure Ruby library for syntax highlighting and is fully supported by Jekyll. The library is integrated with the J1 Theme and supports 100+ script and programming languages. Multiple styles are available to customize the highlighter for light or dark J1 Themes.

Styles selector

For the default theme Uno of J1 Theme, the following Rouge themes are used:

  • light: uno.light (based on the style github)

  • dark: uno.dark (based on the style gruvbox)

The default styles used for J1 Theme can be configured with the global template configuration file ~/_data/j1_config.yml.

Make a selection from the select button below to preview a style for the Rouge Syntax Highlighter.

  • uno.light
  • uno.dark
  • base16
  • base16.dark
  • base16.light
  • base16.monokai
  • base16.monokai.dark
  • base16.monokai.light
  • base16.solarized
  • base16.solarized.dark
  • base16.solarized.light
  • colorful
  • github
  • gruvbox
  • gruvbox.light
  • igorpro
  • molokai
  • monokai
  • monokai.sublime
  • pastie
  • thankful_eyes
  • tulip

Language examples

Find a selected number languages (code blocks) and their highlightning using a selected theme.

Liquid

Hello {{ 'now' | date: "%Y %h" }}
{% comment %}
if item.quantity is 4...
{% endcomment %}
{% for i in (1..item.quantity) %}
  {{ i }}
{% endfor %}
{% comment %} results in 1,2,3,4 {% endcomment %}

Javascript

// ---------------------------------------------------------------
// helper functions
// ---------------------------------------------------------------
function styleSheetLoaded(styleSheet) {
  var sheets     = document.styleSheets,
      stylesheet = sheets[(sheets.length - 1)];
  // find CSS file 'styleSheetName' in document
  for(var i in document.styleSheets) {
    if(sheets[i].href && sheets[i].href.indexOf(styleSheet) > -1) {
      return true;;
    }
  }
}

Ruby

# Load Asciidoctor extensions needed
#
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
include Asciidoctor (1)
Asciidoctor:Extensions.register do
  class J1BlockMacro < Extensions:BlockMacroProcessor
    use_dsl
    named :banner
    name_positional_attributes 'role'
    def process parent, target, attrs
      html = %(<div id="#{target}" class="#{attrs['role']}"></div>)
      create_pass_block parent, html, attrs, subs: nil
    end
  end
  block_macro J1BlockMacro
end
1 don’t miss to load the Asciidoctor ruby

Rouge attributes

You can further customize the source block output with additional Rouge attributes.

Table 1. Rouge attributes
Attribute Description

rouge-css

Controls what method is used for applying CSS to the tokens. Can be class (CSS classes), style (inline styles) or external (external styles). When class is used, Rouge styles for the specified theme are included in an HTML header. When external is specified, CSS classes are used but no styles will be added except when rouge-theme is not empty in which case its value is interpreted as a URL to a style sheet and a link to that style sheet will be added to the HTML header. Default is class.

rouge-theme

Sets the name of the Rouge color theme to use. Look into lib/rouge/themes in the Rouge repository for a list of available themes. Default is github.

rouge-style

Alternative name for the rouge-theme for compatibility with asciidoctor-pdf.

rouge-highlighted-class

CSS class to use on a line wrapper element for highlighted lines. Default is highlighted.

rouge-line-class

CSS class to set on a line wrapper element Default is line.

rouge-line-id

Format string for specifying an HTML id for each line (e.g. with rouge-line-id="L%i" each line of the listing will get an id of the form id="L1", id="L2", etc.). This really only makes sense if the format string is distinct for each source listing, otherwise it will lead to duplicate IDs which makes the generated HTML invalid. Default is no line ids.

Supported languages

Here the list of the (current of Feb, 2022) supported languages and lexers (language highlighters).

A - B

Table 2. Languages|Lexers: A - B
Language Alias Description

abap

abap

The Advanced Business Application Programming Platform language of SAP.

actionscript

as,as3

ActionScript

apache

apache

Configuration files for the Apache web server.

apiblueprint

apib

Markdown based API description language.

applescript

applescript

The AppleScript scripting language by Apple Inc.

awk

awk

Pattern-directed scanning and processing language

biml

biml

BIML, Business Intelligence Markup Language

brainfuck

brainfuck

The Brainfuck programming language. Brainfuck is one of the most famous esoteric programming languages, and has inspired the creation of a host of other languages.

bsl

bsl

The 1C:Enterprise programming language

C - D

Table 3. Languages|Lexers: C - D
Language Alias Description

c

c

The C programming language

ceylon

ceylon

Say more, more clearly.

cfscript

cfc

CFScript, the CFML scripting language

clojure

clj,cljs

The Clojure programming language, a general-purpose programming language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming.

cmake

cmake

The cross-platform, open-source build system

coffeescript

coffee,coffee-script

The Coffeescript programming language

common_lisp

cl,common-lisp,elisp,emacs-lisp

The Common Lisp language, a variant of Lisp having excellent support for object oriented programming, and fast prototyping capabilities.

conf

config,configuration

A generic lexer for configuration files

console

terminal,shell_session,shell-session

A generic lexer for shell sessions. Accepts ?lang and ?output lexer options, a ?prompt option, and ?comments to enable comments.

coq

coq

The Coq is a formal proof management system. It provides a formal language to write mathematical definitions, executable algorithms and theorems together with an environment for semi-interactive development of machine-checked proofs.

cpp

c++

The C++ programming language

crystal

cr

The Crystal Programming Language. Have a syntax similar to Ruby but’s not Ruby.

csharp

c#,cs

A multi-paradigm language targeting .NET.

css

css

Cascading Style Sheets, used to style web pages

d

dlang

The D programming language, a general-purpose programming language with static typing, systems-level access, and C-like syntax.

dart

dart

The Dart programming language, a client-optimized language for fast apps on any platform.

diff

patch,udiff

Lexes unified diffs or patches.

digdag

digdag

The digdag engine. A simple, open source, multi-cloud workflow engine.

docker

dockerfile

The Dockerfile syntax

dot

dot

A graph description language

E - G

Table 4. Languages|Lexers: E - G
Language Alias Description

eiffel

eiffel

The Eiffel programming language, the most comprehensive approach to the construction of successful object-oriented software.

elixir

exs

The Elixir language, designed for building scalable and maintainable applications.

elm

elm

The Elm language, programming delightful data visualization.

erb

eruby,rhtml

Embedded Ruby template files

erlang

erl

The Erlang programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging.

escape

esc

A generic lexer for including escaped content.

factor

factor

A Factor practical stack-based programming language with high-level features including dynamic types, extensible syntax, macros, and garbage collection.

fortran

fortran

The Fortran (2008) language

fsharp

fsharp

The F# functional programming language

gherkin

cucumber,behat

The DSL Gherkin, a business-readable spec DSL

glsl

glsl

The GLSL the principal shading language for OpenGL.

go

golang

The Programming language Go programming language. Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

gradle

gradle

A powerful build system for the JVM. From mobile apps to microservices, from small startups to big enterprises, Gradle helps teams build, automate and deliver better software, faster.

graphql

graphql

The GraphQL query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time,and enables powerful developer tools.

groovy

groovy

The Apache Groovy programming language is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, for the Java platform. Aimed at improving developer productivity thanks to a concise, familiar and easy to learn syntax. It integrates smoothly with any Java program, and immediately delivers to your application powerful features, including scripting capabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functional programming.

H - I

Table 5. Languages|Lexers: H - I
Language Alias Description

hack

hh

The Hack programming language. Hack reconciles the fast development cycle of a dynamically typed language with the discipline provided by static typing, while adding many features commonly found in other modern programming languages.

haml

haml

The Haml templating system for Ruby. Haml (HTML abstraction markup language) is based on one primary principle: markup should be beautiful. It’s not just beauty for beauty’s sake either.

handlebars

hbs,mustache

The Handlebars and Mustache templating languages.

haskell

hs

The Haskell programming language, for advanced and purely functional programming.

hcl

hcl

The Hashicorp Configuration Language, used by Terraform and other Hashicorp tools.

html

html

The HTML markup language, the markup language of the web.

http

http

The Lexer for http requests and responses.

hylang

hy

The HyLang programming language. Hy is a Lisp dialect that’s embedded in Python. Since Hy transforms its Lisp code into Python abstract syntax tree (AST) objects, you have the whole beautiful world of Python at your fingertips, in Lisp form.

idlang

idlang

IDLang, the Interactive Data Language (IDL). IDL is a high-level language for data manipulation, visualization and analysis. IDL has strong signal and image processing capabilities and extensive math and statistical functions.

igorpro

igorpro

The WaveMetrics Igor Pro interactive software environment.

ini

ini

The INI configuration format.

io

io

The IO programming language.

irb

pry

Interactive Ruby Shell sessions in IRB or Pry

J - L

Table 6. Languages|Lexers: J - L
Language Alias Description

java

java

The Java programming language.

javascript

js

The JavaScript language, the browser scripting language.

jinja

django

The Django/Jinja template engine. Jinja is a modern and designer-friendly templating language for Python, modelled after Django’s templates.

json

json

JSON, the JavaScript Object Notation. JSON is a lightweight data-interchange format, specidied for the programming language Javascript. It is easy for humans to read and write. It is easy for machines to parse and generate

json-doc

json-doc

A JSON flavour with extenstions for documentation.

jsonnet

jsonnet

The language Jsonnet is an elegant, formally-specified config language for JSON

jsp

jsp

JSP, the JasperJSP Engine (Apache Tomcat) language specification Java Server Pages. Jasper parses JSP files to compile them into Java code as servlets.

jsx

react

For React, a Javascript-based framework to create UI-components for web development, JSX is a template/tagging specification to produce React elements from.

julia

jl

The Julia programming language. Julia is dynamically typed, feels like a scripting language, and has good support for interactive use. The language has a domain in Data Visualization and Plotting.

kotlin

kotlin

The Kotlin programming language. Kotlin is a modern programming language to replace JAVA-code on JAVA virtual machine (JVM).

lasso

lassoscript

The Lasso programming language. Lasso bridges the gap between popular web servers, data sources (databases), and various other communication tools, utilities, and protocols such as email, directory services (LDAP, Active Directory), web services (SOAP, XMLRPC), and PDF generation.

liquid

liquid

The Liquid markup language. Liquid is a templating engine for Ruby, developed by the makers of Shopify, a professional ecommerce website backed.

literate_coffeescript

litcoffee

The Literate coffeescript is an implementation of literate programming (combining code and documentation) to extend Haskell for the generation of Markdown-based documentation from CoffeeScript programming code.

literate_haskell

lithaskell,lhaskell,lhs

The Literate haskell is an implementation of literate programming (combining code and documentation) for the Haskell proframming language. The tool used to generate hyperlinked documentation from literate code is Haddock.

llvm

llvm

The LLVM Compiler Infrastructure is a collection of modular and reusable compiler and toolchain technologies.

lua

lua

The Lua language. Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.

M - N

Table 7. Languages|Lexers: M - N
Language Alias Description

m68k

m68k

The language Motorola 68k Assembler is the (near hardware) coding language for (the quite old) Motorola 68k processors used for the first personal computer like Amiga, Atari or the first Macintosh PCs from Apple.

magik

magik

The Smallworld Magik, an object-oriented programming language that supports multiple inheritance and polymorphism, and it is dynamically typed. It was designed and implemented in 1989 by Arthur Chance of Smallworld Systems Ltd.. Magik is still a part of the Smallworld technology platform.

make

makefile,mf,gnumake,bsdmake

Code highlighter for the Makefile syntax. Make is a Unix utility, but is available on other platform as well (Linux, Apple OSX or Windows). Make exists in several flavours, is a code build utility for applications based on the programming language C or C++ (C PlusPlus). The Makefile defines the processing chain to compile a program from the sources to an executable.

markdown

md,mkd

The markup language https://daringfireball.net/projects/markdown/[Markdown is a light-weight language for authors to write formatted text using a simple plain-text editor. Markdown code is convert it to structurally valid XHTML or HTML to be displayed in web browsers.

mathematica

wl

Wolfram Mathematica the world’s definitive system for modern technical calculation and computing.

matlab

m

The Matlab language is used by MATLAB programming platform, designed specifically for engineers and scientists. The heart of MATLAB is the MATLAB language, a matrix-based language allowing the most natural expression of computational mathematics.

moonscript

moon

the Moonscript language is a dynamic scripting language that compiles into Lua. It gives the power of one of the fastest scripting languages combined with a rich set of features.

mosel

mosel

The language Mosel is an optimization language used by Fico Xpress. Mosel is an environment for modeling and solving problems that is provided either in the form of libraries or as a standalone program. Mosel includes a language that is both a modeling and a programming language combining the strengths of these two concepts.

mxml

mxml

The MXML markup language is an XML-based user interface markup language that renders and describes graphical user interfaces and controls, first introduced by Macromedia. Application developers use MXML in combination with ActionScript to develop rich Internet applications.

nasm

nasm

The assembler language Netwide Assembler is used for the (Intel) x86 CPU architecture. Portable to nearly every modern platform, and with code generation for many platforms old and new.

nginx

nginx

Hightlights the configuration files for the web server NGINX. NGINX is a high performance Load Balancer and Web Server accelerates content and application delivery, improves security, facilitates availability and scalability for the busiest web sites on the Internet.

nim

nimrod

The Nim programming language (http://nim-lang.org/). Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula.

nix

nixos

The Nix expression language. Nix is a tool that takes a unique approach to package management and system configuration for reproducible builds and deployments.

O - P

Table 8. Languages|Lexers: O - P
Language Alias Description

objective_c

objc,obj-c,obj_c

The language ObjectiveC is an extension of C commonly used to write Apple software.

ocaml

ocaml

The language Objective Caml is an industrial-strength programming language supporting functional, imperative and object-oriented styles.

pascal

pascal

The language Pascal is a procedural programming language commonly used as a teaching language learning programming techniques for computers.

perl

pl

The Perl scripting language. Perl is a highly capable, feature-rich programming language with over 30 years of development.

php

php3,php4,php5

The PHP scripting language. PHP is a popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic. PHP powers everything from your blog to the most popular websites in the world.

plaintext

text

A boring lexer that does not highlight anything

plist

plist

A highlighter for plist preference files for appliactions on Apple platforms.

powershell

posh,microsoftshell,msshell

The PowerShell is a shell (run-time interpreter for terminal sessions) and a task automation and configuration management framework for Microsoft Windows server and client systems. Unlike most shells (e.g on Unix/Linux) which accept and return simple text, PowerShell is built on top of the .NET Common Language Runtime.

praat

praat

The Praat scripting language, used for doing computer-based phonetics.

prolog

prolog

The Prolog programming language. Prolog is a logic programming language associated with artificial intelligence and computational linguistics.

prometheus

prometheus

Prometheusis an open-source monitoring solution that provides a functional query language called PromQL (Prometheus Query Language) that lets the user select and aggregate time series data in real time.

properties

properties

Higlighter for JAVA .properties config files.

protobuf

proto

Google’s ProtoBuf Protocol buffers is a language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.

puppet

pp

The Puppet configuration management language. Puppet is a software configuration management system for the automatisation for typical administration tasks to manage operating systems.

python

py

The Python programming language. Python is an interpreted, object-oriented, high-level programming language.

q

kdb+

The Q programming language. Q serves as the query language for kdb+, a disk or in-memory, column-based database.

Q - S

Table 9. Languages|Lexers: Q - S
Language Alias Description

qml

qml

The QML markup language. QML (Qt Modeling Language) is a user interface markup language. It is a declarative language (similar to CSS and JSON) for designing user interface–centric applications.

r

s

The R statistics language. R is a free software environment for statistical computing and graphics.

racket

racket

The Racket language is a general-purpose, multi-paradigm programming language based on the Scheme dialect of Lisp. It is designed to be a platform for programming language design and implementation.

ruby

rb

The Ruby programming language.

rust

rs,no_run,ignore,should_panic

The Rust programming language.

sass

scss

The Sass stylesheet language language.

scala

scala

The Scala programming language.

scheme

scheme

The Scheme variant of Lisp.

sed

sed

sed, the ultimate stream editor.

shell

bash,zsh,ksh,sh

Lexer for various shell languages, including sh and bash.

sieve

sieve

Mail filtering language

slim

slim

The Slim template language.

smalltalk

st,squeak

The Smalltalk programming language.

smarty

smarty

Smarty Template Engine.

sml

ml

Standard ML.

sqf

sqf

Status Quo Function, a Real Virtuality engine scripting language.

sql

sql

Structured Query Language, for relational databases

supercollider

supercollider

A cross-platform interpreted programming language for sound synthesis, algorithmic composition, and realtime performance.

swift

swift

The language Swift is a multi paradigm, compiled programming language developed by Apple for iOS and OSX development.

T - Z

Table 10. Languages|Lexers: T - Z
Language Alias Description

tap

tap

Test Anything Protocol.

tcl

tcl

The Tool Command Language.

terraform

tf

Terraform HCL Interpolations.

tex

latex

The TeX typesetting system

toml

toml

The TOML configuration format.

tsx

tsx

TSX allows for embedding JSX elements inside the file, and is largely used by React.

tulip

tulip

The Tulip programming language (twitter.com/tuliplang).

turtle

turtle

Terse RDF Triple Language, TriG

twig

twig

The Twig template engine. Twig is a modern template engine for PHP.

typescript

ts

TypeScript, a superset of JavaScript.

vala

vala

A programming language similar to csharp.

vb

visualbasic

The Visual Basic language.

verilog

verilog

The System Verilog hardware description language

vhdl

vhdl

Very High Speed Integrated Circuit Hardware description language.

viml

vim,vimscript,ex

The language VimL is the scripting language for the Vim editor.

vue

vuejs

Vue.js single-file components

wollok

wollok

Wollok lang

xml

xml

The XML markup language.

xojo

realbasic

Xojo

yaml

yaml

The Yaml Ain’t Markup Language. A human friendly data serialization standard for all programming languages.