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



507
508
509
510
# File 'lib/hoe/manualgen.rb', line 507

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.



515
516
517
518
519
520
# File 'lib/hoe/manualgen.rb', line 515

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