summaryrefslogtreecommitdiff
path: root/sample/html2.rb
blob: 618d168dab56db2b8c56c2e022a7751b5906e20a (plain)
1
2
3
4
5
6
7
8
9
10
11
require 'coderay'

# scan this file
tokens = CodeRay.scan(File.read($0) * 1, :ruby)

# output it with two styles of line numbers
out = tokens.div(:line_numbers => :table)
out << '<hr />'
out << tokens.div(:line_numbers => :inline, :line_number_start => 8)

puts out.page(:title => 'CodeRay HTML Encoder Example')