Add BlueCloth example to README.
This commit is contained in:
parent
9eb72a4a52
commit
a743c7db99
26
README.rdoc
26
README.rdoc
|
@ -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
|
Renders <tt>./views/index.markdown</tt> (+md+ and +mkd+ are also valid file
|
||||||
extensions).
|
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) }
|
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!
|
%h1 Hello From Haml!
|
||||||
%p= markdown(:greetings)
|
%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
|
=== Textile Templates
|
||||||
|
|
||||||
The RedCloth gem/library is required to render 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>.
|
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) }
|
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>.
|
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) }
|
erb :overview, :locals => { :text => rdoc(:introduction) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue