RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: venturemedias
To do this with heroku, change syntax_highlighter to the following:
def syntax_highlighter(html) doc = Nokogiri::HTML(html) doc.search("//pre[@lang]").each do |pre| lang = pre[:lang] code = pre.text.rstrip request = Net::HTTP.post_form(URI.parse('http://pygments.appspot.com/'), {'lang'=>lang, 'code'=>code}) pre.replace request.body end doc.to_s end
To do this with heroku, change syntax_highlighter to the following: