Merge pull request #62 from rmetzler/master

code blocks in README.md displayed properly on github (closes #61)
This commit is contained in:
Jonathan Rudenberg
2011-06-19 20:48:03 -07:00
+4 -4
View File
@@ -18,7 +18,7 @@ Liquid is a template engine which I wrote for very specific requirements
## What does it look like? ## What does it look like?
<code> ```html
<ul id="products"> <ul id="products">
{% for product in products %} {% for product in products %}
<li> <li>
@@ -29,14 +29,14 @@ Liquid is a template engine which I wrote for very specific requirements
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</code> ```
## Howto use Liquid ## Howto use Liquid
Liquid supports a very simple API based around the Liquid::Template class. Liquid supports a very simple API based around the Liquid::Template class.
For standard use you can just pass it the content of a file and call render with a parameters hash. For standard use you can just pass it the content of a file and call render with a parameters hash.
<pre> ```ruby
@template = Liquid::Template.parse("hi {{name}}") # Parses and compiles the template @template = Liquid::Template.parse("hi {{name}}") # Parses and compiles the template
@template.render( 'name' => 'tobi' ) # => "hi tobi" @template.render( 'name' => 'tobi' ) # => "hi tobi"
</pre> ```