Module: Rouge

Defined in:
lib/rouge/lexers/php/builtins.rb,
lib/rouge.rb,
lib/rouge/cli.rb,
lib/rouge/util.rb,
lib/rouge/lexer.rb,
lib/rouge/theme.rb,
lib/rouge/token.rb,
lib/rouge/version.rb,
lib/rouge/lexers/c.rb,
lib/rouge/formatter.rb,
lib/rouge/lexers/cpp.rb,
lib/rouge/lexers/css.rb,
lib/rouge/lexers/erb.rb,
lib/rouge/lexers/php.rb,
lib/rouge/lexers/sql.rb,
lib/rouge/lexers/tcl.rb,
lib/rouge/lexers/tex.rb,
lib/rouge/lexers/xml.rb,
lib/rouge/lexers/diff.rb,
lib/rouge/lexers/haml.rb,
lib/rouge/lexers/html.rb,
lib/rouge/lexers/java.rb,
lib/rouge/lexers/make.rb,
lib/rouge/lexers/perl.rb,
lib/rouge/lexers/ruby.rb,
lib/rouge/lexers/sass.rb,
lib/rouge/lexers/scss.rb,
lib/rouge/lexers/text.rb,
lib/rouge/lexers/viml.rb,
lib/rouge/lexers/yaml.rb,
lib/rouge/regex_lexer.rb,
lib/rouge/lexers/shell.rb,
lib/rouge/lexers/factor.rb,
lib/rouge/lexers/groovy.rb,
lib/rouge/lexers/python.rb,
lib/rouge/lexers/scheme.rb,
lib/rouge/text_analyzer.rb,
lib/rouge/themes/base16.rb,
lib/rouge/lexers/clojure.rb,
lib/rouge/lexers/haskell.rb,
lib/rouge/template_lexer.rb,
lib/rouge/formatters/html.rb,
lib/rouge/lexers/markdown.rb,
lib/rouge/themes/colorful.rb,
lib/rouge/lexers/smalltalk.rb,
lib/rouge/lexers/handlebars.rb,
lib/rouge/lexers/javascript.rb,
lib/rouge/plugins/redcarpet.rb,
lib/rouge/lexers/common_lisp.rb,
lib/rouge/lexers/coffeescript.rb,
lib/rouge/lexers/viml/keywords.rb,
lib/rouge/themes/thankful_eyes.rb,
lib/rouge/formatters/terminal256.rb

Overview

DO NOT EDIT: automatically generated by `rake vimkeywords`. see tasks/vim.rake for more info.

Defined Under Namespace

Modules: Formatters, HasModes, Indentation, Lexers, Plugins, Themes Classes: CLI, CSSTheme, Formatter, InheritableHash, InheritableList, Lexer, RegexLexer, TemplateLexer, TextAnalyzer, Theme, Token, Yielder

Class Method Summary collapse

Class Method Details

.highlight(text, lexer, formatter) ⇒ Object


6
7
8
9
10
11
12
13
14
# File 'lib/rouge.rb', line 6

def highlight(text, lexer, formatter)
  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))
end

.versionObject


2
3
4
# File 'lib/rouge/version.rb', line 2

def self.version
  "0.2.5"
end