RegexLexer
# File lib/rouge/lexers/haml.rb, line 16 def self.analyze_text(text) return 0.1 if text.start_with? '!!!' end
@option opts :filters
A hash of filter name to lexer of how various filters should be highlighted. By default, :javascript, :css, :ruby, and :erb are supported.
# File lib/rouge/lexers/haml.rb, line 24 def initialize(opts={}) (opts.delete(:filters) || {}).each do |name, lexer| unless lexer.respond_to? :lex lexer = Lexer.find(lexer) or raise "unknown lexer: #{lexer}" lexer = lexer.new(options) end self.filters[name.to_s] = lexer end super(opts) end
# File lib/rouge/lexers/haml.rb, line 45 def filters @filters ||= { 'javascript' => Javascript.new(options), 'css' => CSS.new(options), 'ruby' => ruby, 'erb' => ERB.new(options), 'markdown' => Markdown.new(options), # TODO # 'sass' => Sass.new(options), # 'textile' => Textile.new(options), # 'maruku' => Maruku.new(options), } end
Generated with the Darkfish Rdoc Generator 2.