summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY.rst (renamed from HISTORY.md)13
-rw-r--r--README.rst (renamed from README.md)39
-rw-r--r--setup.py1
3 files changed, 34 insertions, 19 deletions
diff --git a/HISTORY.md b/HISTORY.rst
index f206a18..ba4ec61 100644
--- a/HISTORY.md
+++ b/HISTORY.rst
@@ -1,4 +1,9 @@
-## 0.2.0 (2010-02-15)
+History
+=======
+
+
+0.2.0 (2010-02-15)
+------------------
* Bugfix: Methods returning False or None are not rendered
* Bugfix: Don't render an empty string when a tag's value is 0. [enaeseth]
@@ -7,11 +12,13 @@
* Support for Unicode and non-ASCII-encoded bytestring output. [enaeseth]
* Template file encoding awareness. [enaeseth]
-## 0.1.1 (2009-11-13)
+0.1.1 (2009-11-13)
+------------------
* Ensure we're dealing with strings, always
* Tests can be run by executing the test file directly
-## 0.1.0 (2009-11-12)
+0.1.0 (2009-11-12)
+------------------
* First release
diff --git a/README.md b/README.rst
index 120a004..886fd25 100644
--- a/README.md
+++ b/README.rst
@@ -1,7 +1,8 @@
+========
Pystache
========
-Inspired by [ctemplate][1] and [et][2], Mustache is a
+Inspired by ctemplate_ and et_, Mustache_ is a
framework-agnostic way to render logic-free views.
As ctemplates says, "It emphasizes separating logic from presentation:
@@ -12,13 +13,15 @@ with Python 2.6.1.
Documentation
--------------
+=============
-The different Mustache tags are documented at [mustache(5)][m5].
+The different Mustache tags are documented at `mustache(5)`_.
Use It
-------
+======
+
+::
>>> import pystache
>>> pystache.render('Hi {{person}}!', {'person': 'Mom'})
@@ -26,24 +29,27 @@ Use It
You can also create dedicated view classes to hold your view logic.
-Here's your simple.py:
+Here's your simple.py::
+
import pystache
class Simple(pystache.View):
def thing(self):
return "pizza"
-Then your template, simple.mustache:
+Then your template, simple.mustache::
+
Hi {{thing}}!
-Pull it together:
+Pull it together::
+
>>> Simple().render()
'Hi pizza!'
Test It
--------
+=======
-[nose][n] works great!
+nose_ works great! ::
easy_install nose
cd pystache
@@ -51,15 +57,16 @@ Test It
Author
-------
+======
+
+::
context = { 'author': 'Chris Wanstrath', 'email': 'chris@ozmm.org' }
pystache.render("{{author}} :: {{email}}", context)
-[1]: http://code.google.com/p/google-ctemplate/
-[2]: http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html
-[3]: http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html
-[4]: http://github.com/defunkt/mustache#readme
-[n]: http://somethingaboutorange.com/mrl/projects/nose/0.11.1/testing.html
-[m5]: http://defunkt.github.com/mustache/mustache.5.html \ No newline at end of file
+.. _ctemplate: http://code.google.com/p/google-ctemplate/
+.. _et: http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html
+.. _Mustache: http://defunkt.github.com/mustache/
+.. _mustache(5): http://defunkt.github.com/mustache/mustache.5.html
+.. _nose: http://somethingaboutorange.com/mrl/projects/nose/0.11.1/testing.html \ No newline at end of file
diff --git a/setup.py b/setup.py
index 06df4ed..5c9c76d 100644
--- a/setup.py
+++ b/setup.py
@@ -16,6 +16,7 @@ if sys.argv[-1] == "publish":
setup(name='pystache',
version='0.2.0',
description='Mustache for Python',
+ long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(),
author='Chris Wanstrath',
author_email='chris@ozmm.org',
url='http://github.com/defunkt/pystache',