Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
04560aca
Commit
04560aca
authored
Mar 28, 2010
by
Damien Lebrun
Committed by
Chris Wanstrath
Mar 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert HISTORY and README to reStructuredText
and use them setup's long_description argument.
parent
feec8f0a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
20 deletions
+35
-20
HISTORY.rst
+10
-3
README.rst
+24
-17
setup.py
+1
-0
No files found.
HISTORY.
md
→
HISTORY.
rst
View file @
04560aca
## 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
README.
md
→
README.
rst
View file @
04560aca
========
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
setup.py
View file @
04560aca
...
...
@@ -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'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment