Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 117 lines (100 sloc) 3.493 kb
de478f6 @mitsuhiko [svn] some small updates to make jinja performing better
authored
1 # -*- coding: utf-8 -*-
5829306 @mitsuhiko moved docstring into setup.py, this fixes #297
authored
2 """
203bfcb @mitsuhiko inheritance uses a less awkward hack for contexts now and subclassing…
authored
3 Jinja2
4 ~~~~~~
5829306 @mitsuhiko moved docstring into setup.py, this fixes #297
authored
5
203bfcb @mitsuhiko inheritance uses a less awkward hack for contexts now and subclassing…
authored
6 Jinja2 is a template engine written in pure Python. It provides a
7 `Django`_ inspired non-XML syntax but supports inline expressions and
8 an optional `sandboxed`_ environment.
5829306 @mitsuhiko moved docstring into setup.py, this fixes #297
authored
9
10 Nutshell
11 --------
12
13 Here a small example of a Jinja template::
14
15 {% extends 'base.html' %}
16 {% block title %}Memberlist{% endblock %}
17 {% block content %}
18 <ul>
19 {% for user in users %}
203bfcb @mitsuhiko inheritance uses a less awkward hack for contexts now and subclassing…
authored
20 <li><a href="{{ user.url }}">{{ user.username }}</a></li>
5829306 @mitsuhiko moved docstring into setup.py, this fixes #297
authored
21 {% endfor %}
22 </ul>
23 {% endblock %}
24
25 Philosophy
26 ----------
27
28 Application logic is for the controller but don't try to make the life
29 for the template designer too hard by giving him too few functionality.
30
f4e1fb4 @mitsuhiko small fix for Python 2.4
authored
31 For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
5829306 @mitsuhiko moved docstring into setup.py, this fixes #297
authored
32
203bfcb @mitsuhiko inheritance uses a less awkward hack for contexts now and subclassing…
authored
33 The `Jinja2 tip`_ is installable via `easy_install` with ``easy_install
34 Jinja2==dev``.
5829306 @mitsuhiko moved docstring into setup.py, this fixes #297
authored
35
36 .. _sandboxed: http://en.wikipedia.org/wiki/Sandbox_(computer_security)
37 .. _Django: http://www.djangoproject.com/
f4e1fb4 @mitsuhiko small fix for Python 2.4
authored
38 .. _Jinja2 webpage: http://jinja.pocoo.org/
1a12c8a @mitsuhiko release trying #3: fixed typos in description :)
authored
39 .. _documentation: http://jinja.pocoo.org/2/documentation/
40 .. _Jinja2 tip: http://dev.pocoo.org/hg/jinja2-main/archive/tip.tar.gz#egg=Jinja2-dev
5829306 @mitsuhiko moved docstring into setup.py, this fixes #297
authored
41 """
0830e25 @mitsuhiko [svn] moved www out of jinja trunk and updated setup.py file
authored
42 import os
d15a4dc @mitsuhiko [svn] updated Jinja setup.py for (hopefully for) win32 compatibility
authored
43 import sys
ee2c18e @mitsuhiko [svn] added c implementation of the jinja context class.
authored
44
10c34da @mitsuhiko Documented switch to MarkupSafe
authored
45 from setuptools import setup, Extension, Feature
46 from distutils.command.build_ext import build_ext
47
48 debugsupport = Feature(
49 'optional C debug support',
50 standard=False,
51 ext_modules = [
52 Extension('jinja2._debugsupport', ['jinja2/_debugsupport.c']),
53 ],
54 )
55
de478f6 @mitsuhiko [svn] some small updates to make jinja performing better
authored
56
0faa861 @mitsuhiko Propably delaying release for better python 3 support. Started workin…
authored
57 # tell distribute to use 2to3 with our own fixers.
58 extra = {}
59 if sys.version_info >= (3, 0):
60 extra.update(
61 use_2to3=True,
62 use_2to3_fixers=['custom_fixers']
63 )
0319c66 @mitsuhiko experimental Python 3 support.
authored
64
4603694 @mitsuhiko Preparing for a 2.5.2 release. Fixed an issue with setup.py
authored
65 # ignore the old '--with-speedups' flag
66 try:
67 speedups_pos = sys.argv.index('--with-speedups')
fe22512 @mitsuhiko Unbroke setup.py
authored
68 except ValueError:
4603694 @mitsuhiko Preparing for a 2.5.2 release. Fixed an issue with setup.py
authored
69 pass
70 else:
71 sys.argv[speedups_pos] = '--with-debugsupport'
c4538a8 @mitsuhiko Improved message and unbroke 3.x
authored
72 sys.stderr.write('*' * 74 + '\n')
73 sys.stderr.write('WARNING:\n')
74 sys.stderr.write(' the --with-speedups flag is deprecated, assuming '
75 '--with-debugsupport\n')
76 sys.stderr.write(' For the actual speedups install the MarkupSafe '
77 'package.\n')
78 sys.stderr.write('*' * 74 + '\n')
4603694 @mitsuhiko Preparing for a 2.5.2 release. Fixed an issue with setup.py
authored
79
0830e25 @mitsuhiko [svn] moved www out of jinja trunk and updated setup.py file
authored
80
de478f6 @mitsuhiko [svn] some small updates to make jinja performing better
authored
81 setup(
203bfcb @mitsuhiko inheritance uses a less awkward hack for contexts now and subclassing…
authored
82 name='Jinja2',
9dc0619 @mitsuhiko Prepare for Jinja 2.5.3
authored
83 version='2.5.3',
015b0c9 @mitsuhiko some documentation changes
authored
84 url='http://jinja.pocoo.org/',
85 license='BSD',
86 author='Armin Ronacher',
87 author_email='armin.ronacher@active-4.com',
88 description='A small but fast and easy to use stand-alone template '
89 'engine written in pure python.',
bd33f11 @mitsuhiko added C escape and tb_set_next functions
authored
90 long_description=__doc__,
86b5cb5 @mitsuhiko (codename Kong, released on September 12th 2009)
authored
91 # jinja is egg safe. But we hate eggs
015b0c9 @mitsuhiko some documentation changes
authored
92 zip_safe=False,
93 classifiers=[
a9d5922 @mitsuhiko fixed development status classification
authored
94 'Development Status :: 5 - Production/Stable',
de478f6 @mitsuhiko [svn] some small updates to make jinja performing better
authored
95 'Environment :: Web Environment',
96 'Intended Audience :: Developers',
97 'License :: OSI Approved :: BSD License',
98 'Operating System :: OS Independent',
99 'Programming Language :: Python',
d9599c8 @mitsuhiko Untagged and added python 3 category.
authored
100 'Programming Language :: Python :: 3',
8ebf1f9 @mitsuhiko [svn] doc update, setup.py update, added turbogears plugin
authored
101 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
102 'Topic :: Software Development :: Libraries :: Python Modules',
103 'Topic :: Text Processing :: Markup :: HTML'
104 ],
f9f5f26 @mitsuhiko MarkupSafe is now used for the Jinja2 speedups
authored
105 packages=['jinja2', 'jinja2.testsuite', 'jinja2.testsuite.res',
106 'jinja2._markupsafe'],
2b60fe5 @mitsuhiko fixed setup.py, a type and removed the possibility to use multiple st…
authored
107 extras_require={'i18n': ['Babel>=0.8']},
7af781c @mitsuhiko Started working on unittest powered testsuite.
authored
108 test_suite='jinja2.testsuite.suite',
790b8a8 @mitsuhiko Approaching python3 compatibility
authored
109 include_package_data=True,
f59bac2 @mitsuhiko added first code for parser extensions and moved some code in speedup…
authored
110 entry_points="""
111 [babel.extractors]
7962ce7 @mitsuhiko fixed babel entry point
authored
112 jinja2 = jinja2.ext:babel_extract[i18n]
0319c66 @mitsuhiko experimental Python 3 support.
authored
113 """,
10c34da @mitsuhiko Documented switch to MarkupSafe
authored
114 features={'debugsupport': debugsupport},
0faa861 @mitsuhiko Propably delaying release for better python 3 support. Started workin…
authored
115 **extra
de478f6 @mitsuhiko [svn] some small updates to make jinja performing better
authored
116 )
Something went wrong with that request. Please try again.