Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix the caffeine monitor blog post.

It was broken due to rendering infrastructure changes in vanilla.
  • Loading branch information...
commit 13734d6a95e1c5ae87b0a1865df12fad4c0da776 1 parent 9072d00
@lazyatom lazyatom authored
View
6 application.rb
@@ -4,7 +4,7 @@
require 'vanilla'
require 'blog'
-require 'kramdown'
+require 'kramdown_renderer'
class Application < Vanilla::App
end
@@ -20,8 +20,8 @@ class Application < Vanilla::App
# You can register additional renderer classes, to be used with snips
# with the given extensions or 'render_as' attributes
config.renderers = {
- :blog => "Vanilla::Renderers::Blog",
- :kramdown => "Vanilla::Renderers::Kramdown"
+ :blog => Vanilla::Renderers::Blog,
+ :kramdown => KramdownRenderer
}
# You can partition your snips into subdirectories to keep things tidy.
View
2  lib/blog.rb
@@ -11,7 +11,7 @@ def prepare(snip, part=:content, args=[], enclosing_snip=snip)
end
def process_text(content)
- renderer = Vanilla::Renderers.const_get(@snip.written_with).new(@app)
+ renderer = app.send(:find_renderer, @snip.written_with).new(@app)
entry_content = renderer.render(@snip)
author = @app.soup[@snip.author]
author_name = author.name.split("-").map { |s| s.capitalize }.join(" ")
View
2  lib/kramdown.rb → lib/kramdown_renderer.rb
@@ -1,7 +1,7 @@
require 'vanilla/renderers/base'
require 'kramdown/document'
-class ::Vanilla::Renderers::Kramdown < ::Vanilla::Renderers::Base
+class KramdownRenderer < ::Vanilla::Renderers::Base
def process_text(content)
Kramdown::Document.new(content).to_html
end
View
2  soups/blog/building-caffeine-monitor.snip
@@ -188,7 +188,7 @@ Cheers!
:render_as: Blog
:kind: blog
-:written_with: Kramdown
+:written_with: kramdown
:author: jason-cale
:page_title: Building Caffeine Monitor
:created_at: 2010-12-06 17:55:03 +00:00
View
2  soups/projects/caffeine-monitor.markdown
@@ -2,7 +2,7 @@ We were approached by [Build][] to work with [Nicholas Felton][] and develop a t
Using a custom HTML5 application running on iPhones, vendors recorded purchases of tea and coffee, and an array of statistics were projected and displayed on screens around the conference.
-Read more about the project in our [blog post](/building-caffeine-monitor), or see a frozen version [here](http://cm.buildconf.com)
+Read more about the project in our [blog post](/building-caffeine-monitor), or see a frozen version [here](http://cm.buildconf.com).
Please sign in to comment.
Something went wrong with that request. Please try again.