abstract class HTML::Pipeline::Filter

Overview

Base Filter

You can write your custom filter by inherit this class.

For example:

class AutolinkFilter < HTML::Pipeline::Filter
  def call
    # do your custom filter
  end
end

And you can find more example in GitHub: https://github.com/huacnlee/html-pipeline/blob/master/src/html-pipeline

Direct Known Subclasses

Defined in:

html-pipeline/filter.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(doc, context : Hash(String, String) = {"" => ""}) #

[View source]

Class Method Detail

def self.call(doc, context = {"" => ""}) #

[View source]

Instance Method Detail

abstract def call #

Must implement this method when you wan't write a custom filter.


[View source]
def context : Hash(String, String) #

[View source]
def doc : XML::Node #

XML::Node type of process data.


[View source]
def html : String #

String type of process data.


[View source]
def parse_html(html : String) #

[View source]