Skip to content
Myr

updated documentation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 58f351d · Browse files · 11 files+168 added−56 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

11 files+168 added−56 removed

  • other:+168 added−56 removed

11 files+168 added−56 removed

added:docs/_static/darkmetal.pngbinary

A binary file, added.

added:docs/_static/jinja.js+26 added
modified:docs/_static/style.css+75 added-37 removed
6 unmodified lines
7 color: #eee;8}910div.footer {11 border-top: 1px solid black;11 border-top: 1px solid #111;12 padding: 8px;13 font-size: 11px;14 text-align: right;14 text-align: center;15 letter-spacing: 0.5px;16}1718div.footer a {19 color: #eee;20}2122div.header {23 margin: 0 -15px 0 -15px;24 background: url(headerbg.png) repeat-x;25 border-top: 6px solid #D20000;26}2728div.relnav {27 border-bottom: 1px solid #ACACAC;29 border-bottom: 1px solid #111;30 background: url(navigation.png);31 margin: 0 -15px 0 -15px;32 padding: 2px 20px 0 28px;33 line-height: 25px;34 color: #aaa;35 font-size: 12px;36 text-align: center;37}3839div.relnav a {40 color: #eee;
7 unmodified lines
4849#content {50 background-color: white;51 color: #111;52 border-bottom: 1px solid black;48 background: url(watermark.png) -110px 0;49 padding: 0;53 background: url(watermark.png) center 0;54 padding: 0 15px 0 15px;55 margin: 0;56}5758h1 {
11 unmodified lines
70 background: #222;71}7273h1.heading a {69 background: url(jinjabanner.png) no-repeat 20px 0;74 background: url(jinjabanner.png) no-repeat center 0;75 display: block;76 width: 100%;77 height: 80px;78}
14 unmodified lines
93 height: 160px;94}9596#contentwrapper {92 max-width: 700px;97 max-width: 680px;98 padding: 0 18px 20px 18px;94 margin: 0 0 0 10px;99 margin: 0 auto 0 auto;100 border-right: 1px solid #eee;101 border-left: 1px solid #eee;97 background: url(watermark_blur.png) -120px -114px;102 background: url(watermark_blur.png) center -114px;103}104105#contentwrapper h2,106#contentwrapper h2 a {
127 unmodified lines
234div.admonition-implementation {235 background: url(implementation.png) no-repeat 10px 40px;236}237233#toc {234 margin: 20px 0 10px 15px;235 padding: 10px;236 width: 200px;237 float: right;238 background-color: #f8f8f8;239 border: 1px solid #ccc;240 border-right: none;241}242243#toc h3 {244 font-size: 20px;245 margin: 0 0 10px 0;246 padding: 0;247 color: #444;248}249250#toc ul {251 margin: 0 0 0 30px;252 padding: 0;253}254255#toc ul li {256 padding: 0;257 margin: 2px 0 2px 0;258}259238a.headerlink {239 color: #B4B4B4!important;240 font-size: 0.8em;263 margin-left: 8px;241 padding: 0 4px 0 4px;242 text-decoration: none!important;243 visibility: hidden;244}
76 unmodified lines
321span.highlight {322 background-color: #eee;323 border: 1px solid #ccc;324}325326#toc {327 margin: 0 -17px 0 -17px;328 display: none;329}330331#toc h3 {332 float: right;333 margin: 5px 5px 0 0;334 padding: 0;335 font-size: 12px;336 color: #777;337}338339#toc h3:hover {340 color: #333;341 cursor: pointer;342}343344.expandedtoc {345 background: #222 url(darkmetal.png);346 border-bottom: 1px solid #111;347 outline-bottom: 1px solid #000;348 padding: 5px;349}350351.expandedtoc h3 {352 color: #aaa;353 margin: 0!important;354}355356.expandedtoc h3:hover {357 color: white!important;358}359360#tod h3:hover {361 color: white;362}363364#toc a {365 color: #ddd;366 text-decoration: none;367}368369#toc a:hover {370 color: white;371 text-decoration: underline;372}373374#toc ul {375 margin: 5px 0 12px 17px;376 padding: 0 7px 0 7px;377}378379#toc ul ul {380 margin-bottom: 0;381}382383#toc ul li {384 margin: 2px 0 0 0;385}
modified:docs/_static/watermark_blur.pngbinary

A binary file, modified.

modified:docs/_static/watermark.pngbinary

A binary file, modified.

modified:docs/_templates/layout.html+7 added-6 removed
modified:docs/faq.rst+15 added-7 removed
126 unmodified lines
127128I don't have the _speedups Module. Is Jinja slower now?129--------------------------------------------------------130131To achieve a good performance with automatic escaping enabled the escaping132function is implemented also written in pure C and used if Jinja2 was133installed with the speedups module which automatically happens if a C134compiled is available on the system. It won't affect templates without135auto escaping much if that feature is not enabled. You may however136experience werid tracebacks if you are using a Python installation, for137more information see the next FAQ item.131To achieve a good performance with automatic escaping enabled, the escaping132function is also implemented in pure C and used if Jinja2 was installed with133the speedups module. This happens automatically if a C compiler is available134on the system during installation.135136My tracebacks look weird. What's happening?137--------------------------------------------138
2 unmodified lines
141Jinja2 is unable to provide correct debugging information and the traceback142may be incomplete. There is currently no good workaround for Jython or143the AppEngine as ctypes is unavailable there and it's not possible to use144the speedups extension.145146Why is there no Python 2.3 support?147-----------------------------------148149Python 2.3 is missing a lot of features that are used heavily in Jinja2. This150decision was made as with the upcoming Python 2.6 and 3.0 versions it becomes151harder to maintain the code for older Python versions. If you really need152Python 2.3 support you either have to use `Jinja 1`_ or other templating153engines that still support 2.3.154155.. _Jinja 1: http://jinja.pocoo.org/1/
modified:docs/jinjaext.py+22 added-1 removed
176 unmodified lines
177 if node.__base__ != object:178 doc.append('', '')179 doc.append('%s :Node type: :class:`%s`' %180 (p, node.__base__.__name__), '')181 # XXX: sphinx bug? Expr gives a rst warning181 doc.append('', '')182 children = node.__subclasses__()183 children.sort(key=lambda x: x.__name__.lower())184 for child in children:
1 unmodified line
186 walk(Node, 0)187 return parse_rst(state, content_offset, doc)188189190def inject_toc(app, doctree, docname):191 titleiter = iter(doctree.traverse(nodes.title))192 try:193 # skip first title, we are not interested in that one194 titleiter.next()195 title = titleiter.next()196 # and check if there is at least another title197 titleiter.next()198 except StopIteration:199 return200 tocnode = nodes.section('')201 tocnode['classes'].append('toc')202 toctitle = nodes.section('')203 toctitle['classes'].append('toctitle')204 toctitle.append(nodes.title(text='Table Of Contents'))205 tocnode.append(toctitle)206 tocnode += doctree.document.settings.env.get_toc_for(docname)[0][1]207 title.parent.insert(title.parent.children.index(title), tocnode)208209210def setup(app):211 app.add_directive('jinjafilters', jinja_filters, 0, (0, 0, 0))212 app.add_directive('jinjatests', jinja_tests, 0, (0, 0, 0))213 app.add_directive('jinjachangelog', jinja_changelog, 0, (0, 0, 0))214 app.add_directive('jinjanodes', jinja_nodes, 0, (0, 0, 0))215 # uncomment for inline toc. links are broken unfortunately216 ##app.connect('doctree-resolved', inject_toc)
modified:docs/templates.rst+13 added
216 unmodified lines
217 ...218 # endfor219220221.. admonition:: Note222223 Line statements can span multiple lines if there are open parentheses,224 braces or brackets::225226 <ul>227 # for href, caption in [('index.html', 'Index'),228 ('about.html', 'About')]:229 <li><a href="{{ href }}">{{ caption }}</a></li>230 # endfor231 </ul>232233234.. _template-inheritance:235236Template Inheritance237--------------------
851 unmodified lines
modified:jinja2/utils.py+5 added-3 removed
291 unmodified lines
292 Markup(u'<em>Hello</em> &lt;foo&gt;')293 """294 __slots__ = ()295296 def __new__(cls, base=u''):296 def __new__(cls, base=u'', encoding=None, errors='strict'):297 if hasattr(base, '__html__'):298 base = base.__html__()299 if encoding is None:299 return unicode.__new__(cls, base)300 return unicode.__new__(cls, base)301 return unicode.__new__(cls, base, encoding, errors)302303 def __html__(self):304 return self305
129 unmodified lines
435436 __getitem__ = lambda s, x: _MarkupEscapeHelper(s.obj[x])437 __unicode__ = lambda s: unicode(escape(s.obj))438 __str__ = lambda s: str(escape(s.obj))437 __repr__ = lambda s: str(repr(escape(s.obj)))439 __repr__ = lambda s: str(escape(repr(s.obj)))440 __int__ = lambda s: int(s.obj)441 __float__ = lambda s: float(s.obj)442443
216 unmodified lines
modified:Makefile+5 added-2 removed
12 unmodified lines
1314test-coverage:15 @(cd tests; py.test -C $(TESTS))1617documentation:18 @(cd docs; ./generate.py)17html-documentation:18 @(cd docs; make html)1920pdf-documentation:21 @(cd docs; make latex; cd _build/latex; make all-pdf)2223webpage:24 @(cd ../www; ./generate.py)2526pylint:
1 unmodified line