# Classes used by the GitHub server task # # Although we don't actually use this, without it: 'uninitialized constant GitHub' require 'github/markup' require 'html/pipeline' require 'html/pipeline/rouge_filter' require 'webrick' module Nox class GitHubRenderer < WEBrick::HTTPServlet::AbstractServlet def initialize config, filename @filename = filename @pipeline = HTML::Pipeline.new [ HTML::Pipeline::MarkdownFilter, HTML::Pipeline::RougeFilter ] end def do_GET req, rsp begin rsp.status = 200 rsp['Content-Type'] = 'text/html' styles = [] styles << %{ } styles << %{ } render = @pipeline.call File.read(@filename) rsp.body = <<-BODY
#{styles.join('')}