Skip to content

Instantly share code, notes, and snippets.

@rue
Created May 13, 2009 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rue/111224 to your computer and use it in GitHub Desktop.
Save rue/111224 to your computer and use it in GitHub Desktop.
## App/Site
application :FarmNoises do
layout_for "text/html" => Waves::Renderers::Hoshi, :template => "templates/html/layout.meh"
end
## Resource
resource :Moo do
renderer_for "text/x-markdown" => lambda {|content| "<div>" + Markdown.render content "</div>" }
renderer_for "text/html" => Waves::Renderers::Hoshi, :template_location => "some pathspec or something"
viewable {
representation "text/plain", "text/x-markdown" do
# The latter just designates the actual Content-Type
response_is "text/x-markdown" => "text/html" do
do_something_returning_string_in_markdown
end
end
}
end
## So, effectively something like:
HoshiRenderer.new(layout).process(MarkdownRenderer.new.call(content_block.call()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment