From a743c7db99e91db3050ff328606d7888603cffa5 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Tue, 11 Jan 2011 09:13:18 +0100 Subject: [PATCH] Add BlueCloth example to README. --- README.rdoc | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/README.rdoc b/README.rdoc index a7a6eeaf..8dde26ad 100644 --- a/README.rdoc +++ b/README.rdoc @@ -351,15 +351,31 @@ The rdiscount gem/library is required to render Markdown templates: Renders ./views/index.markdown (+md+ and +mkd+ are also valid file extensions). -It is not possible to call methods from markdown, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine: +It is not possible to call methods from markdown, nor to pass locals to it. +You therefore will usually use it in combination with another rendering +engine: erb :overview, :locals => { :text => markdown(:introduction) } -Note that you may also call the markdown method from within other templates: +Note that you may also call the +markdown+ method from within other templates: %h1 Hello From Haml! %p= markdown(:greetings) +It is also possible to parse Markdown with BlueCloth rather than RDiscount: + + require 'bluecloth' + + Tilt.register 'markdown', BlueClothTemplate + Tilt.register 'mkd', BlueClothTemplate + Tilt.register 'md', BlueClothTemplate + + get '/' do + markdown :index + end + +Renders ./views/index.md with BlueCloth. + === Textile Templates The RedCloth gem/library is required to render Textile templates: @@ -373,7 +389,8 @@ The RedCloth gem/library is required to render Textile templates: Renders ./views/index.textile. -It is not possible to call methods from textile, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine: +It is not possible to call methods from textile, nor to pass locals to it. You +therefore will usually use it in combination with another rendering engine: erb :overview, :locals => { :text => textile(:introduction) } @@ -395,7 +412,8 @@ The RDoc gem/library is required to render RDoc templates: Renders ./views/index.rdoc. -It is not possible to call methods from rdoc, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine: +It is not possible to call methods from rdoc, nor to pass locals to it. You +therefore will usually use it in combination with another rendering engine: erb :overview, :locals => { :text => rdoc(:introduction) }