summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-10-20 17:06:12 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-10-20 17:06:12 -0700
commit2d645d6db83ebaa5dc40df654983809b0abd4114 (patch)
treebf5d9db63f0b04c5d5c731a5db5f792fca614256 /index.html
parentb93b546955c9e9842cbca545c33c1cd1f24e5247 (diff)
downloadpystache-2d645d6db83ebaa5dc40df654983809b0abd4114.tar.gz
Create gh-pages branch via GitHub
Diffstat (limited to 'index.html')
-rw-r--r--index.html93
1 files changed, 75 insertions, 18 deletions
diff --git a/index.html b/index.html
index db0b06a..d9e54a9 100644
--- a/index.html
+++ b/index.html
@@ -41,7 +41,27 @@
<section>
<h1>Pystache</h1>
-<p><img src="https://s3.amazonaws.com/webdev_bucket/pystache.png" alt="" title="mustachioed, monocled snake by David Phillips"></p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<p><img src="https://raw.github.com/defunkt/pystache/master/gh/images/logo_phillips.png" alt="" title="mustachioed, monocled snake by David Phillips"></p>
+
+<p><img src="https://secure.travis-ci.org/defunkt/pystache.png" alt=""></p>
<p><a href="https://github.com/defunkt/pystache">Pystache</a> is a Python
implementation of <a href="http://mustache.github.com/">Mustache</a>. Mustache is a
@@ -61,8 +81,6 @@ on <a href="http://pypi.python.org/pypi/pystache">PyPI</a>. This version of
Pystache passes all tests in <a href="https://github.com/mustache/spec/tree/v1.1.2">version
1.1.2</a> of the spec.</p>
-<p>Logo: <a href="http://davidphillips.us/">David Phillips</a></p>
-
<h2>Requirements</h2>
<p>Pystache is tested with--</p>
@@ -76,7 +94,16 @@ Pystache passes all tests in <a href="https://github.com/mustache/spec/tree/v1.1
<li> Python 2.7</li>
<li> Python 3.1</li>
<li> Python 3.2</li>
-</ul><p>JSON support is needed only for the command-line interface and to run
+<li> Python 3.3</li>
+<li> <a href="http://pypy.org/">PyPy</a>
+</li>
+</ul><p><a href="http://packages.python.org/distribute/">Distribute</a> (the setuptools fork)
+is recommended over <a href="http://pypi.python.org/pypi/setuptools">setuptools</a>,
+and is required in some cases (e.g. for Python 3 support).
+If you use <a href="http://www.pip-installer.org/">pip</a>, you probably already satisfy
+this requirement.</p>
+
+<p>JSON support is needed only for the command-line interface and to run
the spec tests. We require simplejson for earlier versions of Python
since Python's <a href="http://docs.python.org/library/json.html">json</a> module
was added in Python 2.6.</p>
@@ -92,7 +119,11 @@ as follows:</p>
<h2>Install It</h2>
<pre><code>pip install pystache
-pystache-test
+</code></pre>
+
+<p>And test it--</p>
+
+<pre><code>pystache-test
</code></pre>
<p>To install and test from source (e.g. from GitHub), see the Develop
@@ -165,8 +196,8 @@ slightly differently between Python 2 and 3, as follows:</p>
<ul>
<li> In Python 2, the default html-escape function <code>cgi.escape()</code> does
-not escape single quotes; whereas in Python 3, the default escape
-function <code>html.escape()</code> does escape single quotes.</li>
+not escape single quotes. In Python 3, the default escape function
+<code>html.escape()</code> does escape single quotes.</li>
<li> In both Python 2 and 3, the string and file encodings default to
<code>sys.getdefaultencoding()</code>. However, this function can return
different values under Python 2 and 3, even when run from the same
@@ -217,7 +248,8 @@ default to values set in Pystache's <code>defaults</code> module.</p>
<p>To test Pystache with multiple versions of Python (with a single
command!), you can use <a href="http://pypi.python.org/pypi/tox">tox</a>:</p>
-<pre><code>pip install tox
+<pre><code>pip install 'virtualenv&lt;1.8' # Version 1.8 dropped support for Python 2.4.
+pip install 'tox&lt;1.4' # Version 1.4 dropped support for Python 2.4.
tox
</code></pre>
@@ -248,18 +280,37 @@ parses the json files. To install PyYAML--</p>
nosetests --tests pystache/tests/test_context.py:GetValueTests.test_dictionary__key_present
</code></pre>
-<p><strong>Running Pystache from source with Python 3.</strong> Pystache is written in
-Python 2 and must be converted with
-<a href="http://docs.python.org/library/2to3.html">2to3</a> prior to running under
-Python 3. The installation process (and tox) do this conversion
+<h3>Using Python 3 with Pystache from source</h3>
+
+<p>Pystache is written in Python 2 and must be converted to Python 3 prior to
+using it with Python 3. The installation process (and tox) do this
automatically.</p>
+<p>To convert the code to Python 3 manually (while using Python 3)--</p>
+
+<pre><code>python setup.py build
+</code></pre>
+
+<p>This writes the converted code to a subdirectory called <code>build</code>.
+By design, Python 3 builds
+<a href="https://bitbucket.org/tarek/distribute/issue/292/allow-use_2to3-with-python-2">cannot</a>
+be created from Python 2.</p>
+
+<p>To convert the code without using setup.py, you can use
+<a href="http://docs.python.org/library/2to3.html">2to3</a> as follows (two steps)--</p>
+
+<pre><code>2to3 --write --nobackups --no-diffs --doctests_only pystache
+2to3 --write --nobackups --no-diffs pystache
+</code></pre>
+
+<p>This converts the code (and doctests) in place.</p>
+
<p>To <code>import pystache</code> from a source distribution while using Python 3, be
sure that you are importing from a directory containing a converted
-version (e.g. from your site-packages directory after manually
-installing) and not from the original source directory. Otherwise, you
-will get a syntax error. You can help ensure this by not running the
-Python IDE from the project directory when importing Pystache.</p>
+version of the code (e.g. from the <code>build</code> directory after converting),
+and not from the original (unconverted) source directory. Otherwise, you will
+get a syntax error. You can help prevent this by not running the Python
+IDE from the project directory when importing Pystache while using Python 3.</p>
<h2>Mailing List</h2>
@@ -267,20 +318,26 @@ Python IDE from the project directory when importing Pystache.</p>
that there is a bit of a delay between posting a message and seeing it
appear in the mailing list archive.</p>
-<h2>Authors</h2>
+<h2>Credits</h2>
<pre><code>&gt;&gt;&gt; context = { 'author': 'Chris Wanstrath', 'maintainer': 'Chris Jerdonek' }
&gt;&gt;&gt; print pystache.render("Author: {{author}}\nMaintainer: {{maintainer}}", context)
Author: Chris Wanstrath
Maintainer: Chris Jerdonek
</code></pre>
+
+<p>Pystache logo by <a href="http://davidphillips.us/">David Phillips</a> is licensed
+under a <a href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported
+License</a>.
+<img src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" alt="" title="Creative
+Commons Attribution-ShareAlike 3.0 Unported License"></p>
</section>
<footer>
<p>Project maintained by <a href="https://github.com/cjerdonek">cjerdonek</a></p>
<p><small>Hosted on GitHub Pages &mdash; Theme by <a href="http://twitter.com/#!/michigangraham">mattgraham</a></small></p>
</footer>
</div>
- <!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->
+ <!--[if !IE]><script>fixScale(document);</script><![endif]-->
</body>
</html> \ No newline at end of file