1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Add BlueCloth example to README.

This commit is contained in:
Konstantin Haase 2011-01-11 09:13:18 +01:00
parent 9eb72a4a52
commit a743c7db99

View file

@ -351,15 +351,31 @@ The rdiscount gem/library is required to render Markdown templates:
Renders <tt>./views/index.markdown</tt> (+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 <tt>./views/index.md</tt> 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 <tt>./views/index.textile</tt>.
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 <tt>./views/index.rdoc</tt>.
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) }