This module is included in the output String of the HTML Encoder.
It provides methods like wrap, div, page etc.
Remember to use # instead of # to keep the modules the object was extended with.
TODO: Rewrite this without monkey patching.
# File lib/coderay/encoders/html/output.rb, line 57 57: def apply_title! title 58: self.sub!(/(<title>)(<\/title>)/) { $1 + title + $2 } 59: self 60: end
# File lib/coderay/encoders/html/output.rb, line 88 88: def stylesheet in_tag = false 89: Output.make_stylesheet @css, in_tag 90: end
# File lib/coderay/encoders/html/output.rb, line 62 62: def wrap! element, *args 63: return self if not element or element == wrapped_in 64: case element 65: when :div 66: raise "Can't wrap %p in %p" % [wrapped_in, element] unless wrapped_in? nil 67: wrap_in! DIV 68: when :span 69: raise "Can't wrap %p in %p" % [wrapped_in, element] unless wrapped_in? nil 70: wrap_in! SPAN 71: when :page 72: wrap! :div if wrapped_in? nil 73: raise "Can't wrap %p in %p" % [wrapped_in, element] unless wrapped_in? :div 74: wrap_in! Output.page_template_for_css(@css) 75: if args.first.is_a?(Hash) && title = args.first[:title] 76: apply_title! title 77: end 78: self 79: when nil 80: return self 81: else 82: raise "Unknown value %p for :wrap" % element 83: end 84: @wrapped_in = element 85: self 86: end
# File lib/coderay/encoders/html/output.rb, line 52 52: def wrap_in! template 53: Template.wrap! self, template, 'CONTENT' 54: self 55: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.