Sha256: fc0121a3f642890db355536cadef344817432664b00113d52aa5700881284d49
Contents?: true
Size: 778 Bytes
Versions: 18
Compression:
Stored size: 778 Bytes
Contents
require 'coderay' def highlight_file( file, options = {} ) id = options[:id] || "source" display = options[:display] || "" div( :id => id, :style => "display:#{display};" ) do CodeRay.scan_file(file, :ruby).div(:line_numbers => :table, :css => :class) end end def highlight_me( options = {} ) id = options[:id] || "source" display = options[:display] || "" div( :id => id, :style => "display:#{display};" ) do CodeRay.scan_file(__FILE__, :ruby).div(:line_numbers => :table, :css => :class) end end def highlight_data( data, options = {} ) id = options[:id] || "source" display = options[:display] || "" div( :id => id, :style => "display:#{display};" ) do CodeRay.scan(data, :ruby).div(:line_numbers => :table, :css => :class) end end
Version data entries
18 entries across 18 versions & 1 rubygems