require 'rdiscount' require 'erb' require 'base64' require 'mime/types' require 'cgi' module Markout class Html < Formatter def export suck_in_images! ERB.new( File.read(template_path.join('content.rhtml')) ).result(binding) end private def template_name @options[:template] || 'default' end def template_path Pathname.new( File.join( File.dirname(__FILE__), 'templates', template_name ) ) end def content @content ||= RDiscount.new( @document.content ).to_html end def screen_style File.read template_path.join('screen.css') end def print_style File.read template_path.join('print.css') end def syntax_highlighter s = '' s << '' s << '' s << '' end def jquery File.read( template_path.join('..', 'common', 'jquery-1.3.2.min.js') ) end def application_js File.read( template_path.join('..', 'common', 'application.js') ) end def title h1 = content.match(/