class Gollum::Filter

Public Class Methods

new(markup) click to toggle source

Setup the object. Sets `@markup` to be the instance of Gollum::Markup that is running this filter chain, and sets `@map` to be an empty hash (for use in your extract/process operations).

# File lib/gollum-lib/filter.rb, line 53
def initialize(markup)
  @markup = markup
  @map    = {}
end

Public Instance Methods

extract(_d) click to toggle source
# File lib/gollum-lib/filter.rb, line 58
def extract(_d)
  raise RuntimeError,
        "#{self.class} has not implemented ##extract!"
end
process(_d) click to toggle source
# File lib/gollum-lib/filter.rb, line 63
def process(_d)
  raise RuntimeError,
        "#{self.class} has not implemented ##process!"
end

Protected Instance Methods

html_error(message) click to toggle source

Render a (presumably) non-fatal error as HTML

# File lib/gollum-lib/filter.rb, line 71
def html_error(message)
  "<p class=\"gollum-error\">#{message}</p>"
end