An abstract filter class for manual content transformation.
Inheritance callback – keep track of all inheriting classes for later.
# File lib/hoe/manualgen.rb, line 489
def self::inherited( subclass )
key = subclass.name.
sub( /^.*::/, '' ).
gsub( /[^[:alpha:]]+/, '_' ).
downcase.
sub( /filter$/, '' )
self.derivatives[ key ] = subclass
self.derivatives[ key.to_sym ] = subclass
super
end
Export any static resources required by this filter to the given
output_dir
.
# File lib/hoe/manualgen.rb, line 504
def export_resources( output_dir )
# No-op by default
end
Process the page
's source with the filter and return the
altered content.
# File lib/hoe/manualgen.rb, line 510
def process( source, page, metadata )
raise NotImplementedError,
"%s does not implement the #process method" % [ self.class.name ]
end