Sha256: 994af7465fb4cbff6ba14f7e1ea81120a78f92da2852ef29f705a20b3308b5f7

Contents?: true

Size: 542 Bytes

Versions: 6

Compression:

Stored size: 542 Bytes

Contents

module InlineFilter

  def inline(input)
    page = Comatose::Page.find_by_path(input)
    # Comatose.logger.debug "InlineFilter: context: #{@context['current_user']}"
    # TODO: Add more of the context into the included page's context...
    page.to_html({ 'params' => @context['params'], 'system' => @context['system'] })
  rescue => e
    Comatose.logger.debug e.message
    Comatose.logger.debug e.backtrace.join("\n")
    "Page at <tt>#{input}</tt> could not be found. <pre>#{$!}</pre>"
  end
end

Comatose.register_filter InlineFilter

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
comatose-rubyisbeautiful-3.0.5 lib/comatose/filters/inline_filter.rb
comatose-rubyisbeautiful-3.0.4 lib/comatose/filters/inline_filter.rb
comatose-rubyisbeautiful-3.0.3 lib/comatose/filters/inline_filter.rb
comatose-rubyisbeautiful-3.0.2 lib/comatose/filters/inline_filter.rb
comatose-rubyisbeautiful-3.0.1 lib/comatose/filters/inline_filter.rb
comatose-rubyisbeautiful-3.0.0 lib/comatose/filters/inline_filter.rb