Provides syntax highlighting via the coderay library.
Highlight the body of the block.
# File lib/webgen/tag/coderay.rb, line 12 12: def call(tag, body, context) 13: require 'coderay' 14: 15: options = {} 16: if param('tag.coderay.css').to_s == 'other' 17: options[:css] = :class 18: elsif param('tag.coderay.css').to_s == 'class' 19: options[:css] = :class 20: default_css_style_node = context.dest_node.resolve('/stylesheets/coderay-default.css') 21: ((context.persistent[:cp_head] ||= {})[:css_file] ||= []) << context.dest_node.route_to(default_css_style_node) 22: context.dest_node.node_info[:used_meta_info_nodes] << default_css_style_node.alcn 23: else 24: options[:css] = :style 25: end 26: options.merge!(:wrap => param('tag.coderay.wrap').to_sym, 27: :line_numbers => (param('tag.coderay.line_numbers') ? :inline : nil), 28: :line_number_start => param('tag.coderay.line_number_start'), 29: :tab_width => param('tag.coderay.tab_width'), 30: :bold_every => param('tag.coderay.bold_every')) 31: 32: if param('tag.coderay.process_body') 33: body = website.blackboard.invoke(:content_processor, 'tags').call(context.clone(:content => body)).content 34: end 35: CodeRay.scan(body, param('tag.coderay.lang').to_sym).html(options) 36: rescue LoadError 37: raise Webgen::LoadError.new('coderay', self.class.name, context.dest_node, 'coderay') 38: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.