Find file
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (20 sloc) 481 Bytes
require 'mustache'
require 'mustache/plugins/syntax_highlighter'
class Dude < Mustache
include Mustache::Plugins::SyntaxHighlighter
def name
"Chris"
end
end
Dude.template = <<template
<html><head>
<link href="http://pygments.org/media/pygments_style.css" media="screen" rel="stylesheet" type="text/css" />
</head><body><div class="syntax">
{{# highlight_ruby}}
def hello
puts "Hi {{name}}!"
end
{{/ highlight_ruby}}
</div></body></html>
template
puts Dude.render