Commit 8b92c96f by Chris Jerdonek

README formatting tweaks.

parent d595856b
...@@ -41,16 +41,18 @@ Use It ...@@ -41,16 +41,18 @@ Use It
You can also create dedicated view classes to hold your view logic. You can also create dedicated view classes to hold your view logic.
Here's your view class (in `examples/readme.py`):: Here's your view class (in ``examples/readme.py``)::
class SayHello(object): class SayHello(object):
def to(self): def to(self):
return "World" return "Pizza"
Like so::
>>> from examples.readme import SayHello >>> from examples.readme import SayHello
>>> hello = SayHello() >>> hello = SayHello()
Then your template, `say_hello.mustache`:: Then your template, ``say_hello.mustache``::
Hello, {{to}}! Hello, {{to}}!
...@@ -58,7 +60,7 @@ Pull it together:: ...@@ -58,7 +60,7 @@ Pull it together::
>>> renderer = pystache.Renderer() >>> renderer = pystache.Renderer()
>>> renderer.render(hello) >>> renderer.render(hello)
u'Hello, World!' u'Hello, Pizza!'
Test It Test It
...@@ -76,7 +78,7 @@ To include tests from the mustache spec_ in your test runs: :: ...@@ -76,7 +78,7 @@ To include tests from the mustache spec_ in your test runs: ::
git submodule update git submodule update
nosetests -i spec nosetests -i spec
To run all available tests: To run all available tests::
nosetests --with-doctest --doctest-extension=rst -i spec nosetests --with-doctest --doctest-extension=rst -i spec
......
class SayHello(object): class SayHello(object):
def to(self): def to(self):
return "World" return "Pizza"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment