Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 111 lines (95 sloc) 3.257 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
33 .. _sandboxed: http://en.wikipedia.org/wiki/Sandbox_(computer_security)
34 .. _Django: http://www.djangoproject.com/
f4e1fb4 @mitsuhiko small fix for Python 2.4
authored
35 .. _Jinja2 webpage: http://jinja.pocoo.org/
1a12c8a @mitsuhiko release trying #3: fixed typos in description :)
authored
36 .. _documentation: http://jinja.pocoo.org/2/documentation/
5829306 @mitsuhiko moved docstring into setup.py, this fixes #297
authored
37 """
d15a4dc @mitsuhiko [svn] updated Jinja setup.py for (hopefully for) win32 compatibility
authored
38 import sys
ee2c18e @mitsuhiko [svn] added c implementation of the jinja context class.
authored
39
10c34da @mitsuhiko Documented switch to MarkupSafe
authored
40 from setuptools import setup, Extension, Feature
41
42 debugsupport = Feature(
43 'optional C debug support',
44 standard=False,
45 ext_modules = [
46 Extension('jinja2._debugsupport', ['jinja2/_debugsupport.c']),
47 ],
48 )
49
de478f6 @mitsuhiko [svn] some small updates to make jinja performing better
authored
50
0faa861 @mitsuhiko Propably delaying release for better python 3 support. Started workin…
authored
51 # tell distribute to use 2to3 with our own fixers.
52 extra = {}
53 if sys.version_info >= (3, 0):
54 extra.update(
55 use_2to3=True,
56 use_2to3_fixers=['custom_fixers']
57 )
0319c66 @mitsuhiko experimental Python 3 support.
authored
58
4603694 @mitsuhiko Preparing for a 2.5.2 release. Fixed an issue with setup.py
authored
59 # ignore the old '--with-speedups' flag
60 try:
61 speedups_pos = sys.argv.index('--with-speedups')
fe22512 @mitsuhiko Unbroke setup.py
authored
62 except ValueError:
4603694 @mitsuhiko Preparing for a 2.5.2 release. Fixed an issue with setup.py
authored
63 pass
64 else:
65 sys.argv[speedups_pos] = '--with-debugsupport'
c4538a8 @mitsuhiko Improved message and unbroke 3.x
authored
66 sys.stderr.write('*' * 74 + '\n')
67 sys.stderr.write('WARNING:\n')
68 sys.stderr.write(' the --with-speedups flag is deprecated, assuming '
69 '--with-debugsupport\n')
70 sys.stderr.write(' For the actual speedups install the MarkupSafe '
71 'package.\n')
72 sys.stderr.write('*' * 74 + '\n')
4603694 @mitsuhiko Preparing for a 2.5.2 release. Fixed an issue with setup.py
authored
73
0830e25 @mitsuhiko [svn] moved www out of jinja trunk and updated setup.py file
authored
74
de478f6 @mitsuhiko [svn] some small updates to make jinja performing better
authored
75 setup(
203bfcb @mitsuhiko inheritance uses a less awkward hack for contexts now and subclassing…
authored
76 name='Jinja2',
44e1f56 @mitsuhiko master will be 2.6
authored
77 version='2.6',
015b0c9 @mitsuhiko some documentation changes
authored
78 url='http://jinja.pocoo.org/',
79 license='BSD',
80 author='Armin Ronacher',
81 author_email='armin.ronacher@active-4.com',
82 description='A small but fast and easy to use stand-alone template '
83 'engine written in pure python.',
bd33f11 @mitsuhiko added C escape and tb_set_next functions
authored
84 long_description=__doc__,
86b5cb5 @mitsuhiko (codename Kong, released on September 12th 2009)
authored
85 # jinja is egg safe. But we hate eggs
015b0c9 @mitsuhiko some documentation changes
authored
86 zip_safe=False,
87 classifiers=[
a9d5922 @mitsuhiko fixed development status classification
authored
88 'Development Status :: 5 - Production/Stable',
de478f6 @mitsuhiko [svn] some small updates to make jinja performing better
authored
89 'Environment :: Web Environment',
90 'Intended Audience :: Developers',
91 'License :: OSI Approved :: BSD License',
92 'Operating System :: OS Independent',
93 'Programming Language :: Python',
d9599c8 @mitsuhiko Untagged and added python 3 category.
authored
94 'Programming Language :: Python :: 3',
8ebf1f9 @mitsuhiko [svn] doc update, setup.py update, added turbogears plugin
authored
95 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
96 'Topic :: Software Development :: Libraries :: Python Modules',
97 'Topic :: Text Processing :: Markup :: HTML'
98 ],
f9f5f26 @mitsuhiko MarkupSafe is now used for the Jinja2 speedups
authored
99 packages=['jinja2', 'jinja2.testsuite', 'jinja2.testsuite.res',
100 'jinja2._markupsafe'],
2b60fe5 @mitsuhiko fixed setup.py, a type and removed the possibility to use multiple st…
authored
101 extras_require={'i18n': ['Babel>=0.8']},
7af781c @mitsuhiko Started working on unittest powered testsuite.
authored
102 test_suite='jinja2.testsuite.suite',
790b8a8 @mitsuhiko Approaching python3 compatibility
authored
103 include_package_data=True,
f59bac2 @mitsuhiko added first code for parser extensions and moved some code in speedup…
authored
104 entry_points="""
105 [babel.extractors]
7962ce7 @mitsuhiko fixed babel entry point
authored
106 jinja2 = jinja2.ext:babel_extract[i18n]
0319c66 @mitsuhiko experimental Python 3 support.
authored
107 """,
10c34da @mitsuhiko Documented switch to MarkupSafe
authored
108 features={'debugsupport': debugsupport},
0faa861 @mitsuhiko Propably delaying release for better python 3 support. Started workin…
authored
109 **extra
de478f6 @mitsuhiko [svn] some small updates to make jinja performing better
authored
110 )
Something went wrong with that request. Please try again.