module Rouge
The containing module for Rouge
- jneen
-
This is an example implementation only. You may use it as-is, but please do
not submit patches that alter the behaviour or options of this formatter for the convenience of your application. You are highly encouraged to write your own formatter for your application instead.
- jneen
-
This is an example implementation only. You may use it as-is, but please do
not submit patches that alter the behaviour or options of this formatter for the convenience of your application. You are highly encouraged to write your own formatter for your application instead.
- jneen
-
This is an example implementation only. You may use it as-is, but please do
not submit patches that alter the behaviour or options of this formatter for the convenience of your application. You are highly encouraged to write your own formatter for your application instead.
- jneen
-
This is an example implementation only. You may use it as-is, but please do
not submit patches that alter the behaviour or options of this formatter for the convenience of your application. You are highly encouraged to write your own formatter for your application instead.
- jneen
-
This is an example implementation only. You may use it as-is, but please do
not submit patches that alter the behaviour or options of this formatter for the convenience of your application. You are highly encouraged to write your own formatter for your application instead.
- jneen
-
This is an example implementation only. You may use it as-is, but please do
not submit patches that alter the behaviour or options of this formatter for the convenience of your application. You are highly encouraged to write your own formatter for your application instead.
- jneen
-
This is an example implementation only. You may use it as-is, but please do
not submit patches that alter the behaviour or options of this formatter for the convenience of your application. You are highly encouraged to write your own formatter for your application instead.
ABAP keywords, builtins, RAP syntax and CDS syntax taken from
help.sap.com/doc/abapdocu_758_index_htm/7.58/en-US/index.htm?file=abenabap_shortref.htm help.sap.com/doc/abapdocu_758_index_htm/7.58/en-us/abenbuilt_in_functions_overview.htm help.sap.com/doc/abapdocu_758_index_htm/7.58/en-US/abencds_language_elements.htm help.sap.com/doc/abapdocu_758_index_htm/7.58/en-us/abenabap_words.htm
Updated with modern ABAP 7.40+ and CDS keywords from ABAP 7.58 documentation
This file is manually maintained by Manuel Laggner <manuel@laggner.info>
Please contact them with any requests for updates.
DO NOT EDIT This file is automatically generated by ‘rake builtins:apache`. See tasks/builtins/apache.rake for more info.
Regular expressions based on github.com/SaswatPadhi/prismjs-bibtex and github.com/alecthomas/chroma/blob/master/lexers/b/bibtex.go
Based on/regexes mostly from Brandon Bennett’s pygments-routerlexers: github.com/nemith/pygments-routerlexers
TODO: Implement format list support.
C minus minus (Cmm) is a pun on the name C++. It’s an intermediate language of the Glasgow Haskell Compiler (GHC) that is very similar to C, but with many features missing and some special constructs.
Cmm is a dialect of C–. The goal of this lexer is to use what GHC produces and parses (Cmm); C– itself is not supported.
gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/cmm-syntax
See www.cs.cmu.edu/afs/andrew/course/15/411/ghc/share/doc/ghc/ext-core/core.pdf for a description of the syntax of the language and www.aosabook.org/en/ghc.html for a high level overview.
DO NOT EDIT This file is automatically generated by ‘rake builtins:gherkin`. See tasks/builtins/gherkin.rake for more info.
DO NOT EDIT This file is automatically generated by ‘rake builtins:glsl`. See tasks/builtins/glsl.rake for more info.
vim: set ts=2 sw=2 et:
This file is manually maintained by Michael Huth: michael.huth@byte-physics.de
Lexer adapted from github.com/pygments/pygments/blob/ad55974ce83b85dbb333ab57764415ab84169461/pygments/lexers/theorem.py
DO NOT EDIT This file is automatically generated by ‘rake builtins:lasso`. See tasks/builtins/lasso.rake for more info.
NOTE: This is for Lean 3 (community fork).
DO NOT EDIT This file is automatically generated by ‘rake builtins:llvm`. See tasks/builtins/llvm.rake for more info.
This file is automatically generated by ‘rake builtins:lua`. See tasks/builtins/lua.rake for more info.
This file is automatically generated by ‘rake builtins:mathematica`. See tasks/builtins/mathematica.rake for more info.
This file is automatically generated by ‘rake builtins:matlab`. See tasks/builtins/matlab.rake for more info.
Based on Chroma’s MiniZinc lexer: github.com/alecthomas/chroma/blob/5152194c717b394686d3d7a7e1946a360ec0728f/lexers/m/minizinc.go
Based on Chroma’s NASM lexer implementation github.com/alecthomas/chroma/blob/498eaa690f5ac6ab0e3d6f46237e547a8935cdc7/lexers/n/nasm.go
PDF = Portable Document Format page description language As defined by ISO 32000-2:2020 including resolved errata from pdf-issues.pdfa.org/
The PDF syntax is also known as “COS” and can be used with FDF (Forms Data Field) files as per ISO 32000-2:2020 clause 12.7.8.
This is a token-based parser ONLY! It is intended to syntax highlight full or partial fragments of nicely written hand-written PDF syntax in documentation such as ISO specifications. It is NOT intended to cope with real-world PDFs that will contain arbitrary binary data (that form invalid UTF-8 sequences and generate “ArgumentError: invalid byte sequence in UTF-8” Ruby errors) and other types of malformations or syntax errors.
Author: Peter Wyatt, CTO, PDF Association. 2024
DO NOT EDIT This file is automatically generated by ‘rake builtins:php`. See tasks/builtins/php.rake for more info.
Adapted from pygments PostScriptLexer
DO NOT EDIT This file is automatically generated by ‘rake builtins:sqf`. See tasks/builtins/sqf.rake for more info.
DO NOT EDIT This file is automatically generated by ‘rake builtins:viml`. See tasks/builtins/viml.rake for more info.
this file is not require’d from the root. To use this plugin, run:
require 'rouge/plugins/redcarpet'
TODO how are we going to handle soft/hard contrast?
Constants
- LIB_DIR
-
cache value in a constant since ‘__dir__` allocates a new string on every call.
Public Class Methods
Source
# File lib/rouge.rb, line 46 def eager_load! Rouge::Lexer.all.each(&:eager_load!) end
Source
# File lib/rouge.rb, line 36 def highlight(text, lexer, formatter, &b) lexer = Lexer.find(lexer) unless lexer.respond_to? :lex raise "unknown lexer #{lexer}" unless lexer formatter = Formatter.find(formatter) unless formatter.respond_to? :format raise "unknown formatter #{formatter}" unless formatter formatter.format(lexer.lex(text), &b) end
Highlight some text with a given lexer and formatter.
@example
Rouge.highlight('@foo = 1', 'ruby', 'html') Rouge.highlight('var foo = 1;', 'js', 'terminal256') # streaming - chunks become available as they are lexed Rouge.highlight(large_string, 'ruby', 'html') do |chunk| $stdout.print chunk end
Source
# File lib/rouge.rb, line 20 def reload! Kernel::warn "Rouge.reload! is deprecated, with no replacement, and will be removed in 5.0. Use a reloading system like Guard instead." Object::send :remove_const, :Rouge Kernel::load __FILE__ end
@deprecated This method of reloading is incompatible with modern Ruby’s expectations around global caching of ‘require`. It is deprecated with no replacement - consider reloading the entire process instead with something like Guard. This method will be removed in rouge 5.0.