#-- # Dokkit filter for Deplate # (c)2006 Andrea Fazzi (and contributors) # # See 'dokkit.rb' or LICENSE for licence information. require 'deplate/converter' require 'deplate/core' require 'rote/filters/base' require 'dokkit/deplate/fmt/latex-notemplate' require 'dokkit/deplate/fmt/html-notemplate' module Dokkit module Filters def Filters.declare_formatters ::Deplate::Core.declare_formatter(::Deplate::Formatter::LatexNoTemplate,'latex-notemplate') ::Deplate::Core.declare_formatter(::Deplate::Formatter::HTMLNoTemplate,'html-notemplate') end ##### ## Page filter that converts emacs-wiki formatting in various formats (tex, html, ## docbook, plain text, etc.) using deplate. ## class Deplate < Rote::Filters::TextFilter Filters.declare_formatters # Create a new filter instance. If a block is defined returns a Deplate::Converter instance. # You can supply options directly to the instance. See deplate docs for a full list # of options. def initialize(formatter) super() @deplate = ::Deplate::Converter.new(formatter) { |instance| yield(instance) if block_given? } end def handler(text,page) @deplate.convert_string(text) end end end end