Class: Hoe::ManualGen::TextileFilter

Inherits:
PageFilter
  • Object
show all
Defined in:
lib/hoe/manualgen.rb

Overview

A Textile filter for the manual generation tasklib.

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ TextileFilter

Load RedCloth when the filter is first created



523
524
525
526
# File 'lib/hoe/manualgen.rb', line 523

def initialize( *args )
	require 'redcloth'
	super
end

Instance Method Details

#process(source, *ignored) ⇒ Object

Process the given source as Textile and return the resulting HTML fragment.



531
532
533
534
535
536
# File 'lib/hoe/manualgen.rb', line 531

def process( source, *ignored )
	formatter = RedCloth::TextileDoc.new( source )
	formatter.hard_breaks = false
	formatter.no_span_caps = true
	return formatter.to_html
end