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
Provenance
- Commit
3ef2043- Tree
e774c10- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
58f351d
11 files changed+168 added−56 removed
added:docs/_static/darkmetal.pngbinary
A binary file, added.
added:docs/_static/jinja.js+26 added
1234567891011121314151617181920212223242526$(function() {
var toc = $('#toc').show(), items = $('#toc > ul').hide();
$('#toc h3') .click(function() { if (items.is(':visible')) { items.animate({ height: 'hide', opacity: 'hide' }, 300, function() { toc.removeClass('expandedtoc'); }); } else { items.animate({ height: 'show', opacity: 'show' }, 400); toc.addClass('expandedtoc'); } });
});modified:docs/_static/style.css+75 added-37 removed
6 unmodified lines7 color: #eee;8 }9 10 div.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 }17 18 div.footer a {19 color: #eee;20 }21 22 div.header {23+ margin: 0 -15px 0 -15px;24 background: url(headerbg.png) repeat-x;25 border-top: 6px solid #D20000;26 }27 28 div.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 }38 39 div.relnav a {40 color: #eee;7 unmodified lines48 49 #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 }57 58 h1 {11 unmodified lines70 background: #222;71 }72 73 h1.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 lines93 height: 160px;94 }95 96 #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 }104 105 #contentwrapper h2,106 #contentwrapper h2 a {127 unmodified lines234 div.admonition-implementation {235 background: url(implementation.png) no-repeat 10px 40px;236 }237 233-#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-}242-243-#toc h3 {244- font-size: 20px;245- margin: 0 0 10px 0;246- padding: 0;247- color: #444;248-}249-250-#toc ul {251- margin: 0 0 0 30px;252- padding: 0;253-}254-255-#toc ul li {256- padding: 0;257- margin: 2px 0 2px 0;258-}259-238 a.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 lines321 span.highlight {322 background-color: #eee;323 border: 1px solid #ccc;324 }325+326+#toc {327+ margin: 0 -17px 0 -17px;328+ display: none;329+}330+331+#toc h3 {332+ float: right;333+ margin: 5px 5px 0 0;334+ padding: 0;335+ font-size: 12px;336+ color: #777;337+}338+339+#toc h3:hover {340+ color: #333;341+ cursor: pointer;342+}343+344+.expandedtoc {345+ background: #222 url(darkmetal.png);346+ border-bottom: 1px solid #111;347+ outline-bottom: 1px solid #000;348+ padding: 5px;349+}350+351+.expandedtoc h3 {352+ color: #aaa;353+ margin: 0!important;354+}355+356+.expandedtoc h3:hover {357+ color: white!important;358+}359+360+#tod h3:hover {361+ color: white;362+}363+364+#toc a {365+ color: #ddd;366+ text-decoration: none;367+}368+369+#toc a:hover {370+ color: white;371+ text-decoration: underline;372+}373+374+#toc ul {375+ margin: 5px 0 12px 17px;376+ padding: 0 7px 0 7px;377+}378+379+#toc ul ul {380+ margin-bottom: 0;381+}382+383+#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
14 unmodified lines15161718192021222334 unmodified lines5859606161626364656662636465666768697071725 unmodified lines14 unmodified lines </script> <script type="text/javascript" src="{{ pathto('_static/jquery.js', 1) }}"></script> <script type="text/javascript" src="{{ pathto('_static/interface.js', 1) }}"></script> <script type="text/javascript" src="{{ pathto('_static/doctools.js', 1) }}"></script> <script type="text/javascript" src="{{ pathto('_static/jinja.js', 1) }}"></script> {%- endif %} {%- if use_opensearch and builder != 'htmlhelp' %} <link rel="search" type="application/opensearchdescription+xml" title="Search within {{ docstitle }}"34 unmodified lines {%- if next %} | <a href="{{ next.link|e }}">{{ next.title }} »</a> {%- endif %} </div> {%- if display_toc %} <div id="toc"> <h3>Table Of Contents</h3> {{ toc }} </div> {%- endif %} <div id="contentwrapper"> {%- if display_toc %} <div id="toc"> <h3>Table Of Contents</h3> {{ toc }} </div> {%- endif %} {% block body %}{% endblock %} </div> </div> <div class="footer">5 unmodified linesmodified:docs/faq.rst+15 added-7 removed
126 unmodified lines127 128 I don't have the _speedups Module. Is Jinja slower now?129 --------------------------------------------------------130 131-To achieve a good performance with automatic escaping enabled the escaping132-function is implemented also written in pure C and used if Jinja2 was133-installed with the speedups module which automatically happens if a C134-compiled is available on the system. It won't affect templates without135-auto escaping much if that feature is not enabled. You may however136-experience werid tracebacks if you are using a Python installation, for137-more information see the next FAQ item.131+To achieve a good performance with automatic escaping enabled, the escaping132+function is also implemented in pure C and used if Jinja2 was installed with133+the speedups module. This happens automatically if a C compiler is available134+on the system during installation.135 136 My tracebacks look weird. What's happening?137 --------------------------------------------138 2 unmodified lines141 Jinja2 is unable to provide correct debugging information and the traceback142 may be incomplete. There is currently no good workaround for Jython or143 the AppEngine as ctypes is unavailable there and it's not possible to use144 the speedups extension.145+146+Why is there no Python 2.3 support?147+-----------------------------------148+149+Python 2.3 is missing a lot of features that are used heavily in Jinja2. This150+decision was made as with the upcoming Python 2.6 and 3.0 versions it becomes151+harder to maintain the code for older Python versions. If you really need152+Python 2.3 support you either have to use `Jinja 1`_ or other templating153+engines that still support 2.3.154+155+.. _Jinja 1: http://jinja.pocoo.org/1/modified:docs/jinjaext.py+22 added-1 removed
176 unmodified lines177 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 line186 walk(Node, 0)187 return parse_rst(state, content_offset, doc)188 189 190+def 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)208+209+210 def 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 lines217 ...218 # endfor219 220 221+.. admonition:: Note222+223+ Line statements can span multiple lines if there are open parentheses,224+ braces or brackets::225+226+ <ul>227+ # for href, caption in [('index.html', 'Index'),228+ ('about.html', 'About')]:229+ <li><a href="{{ href }}">{{ caption }}</a></li>230+ # endfor231+ </ul>232+233+234 .. _template-inheritance:235 236 Template Inheritance237 --------------------851 unmodified linesmodified:jinja2/utils.py+5 added-3 removed
291 unmodified lines292 Markup(u'<em>Hello</em> <foo>')293 """294 __slots__ = ()295 296- 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)302 303 def __html__(self):304 return self305 129 unmodified lines435 436 __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)442 443 216 unmodified linesmodified:Makefile+5 added-2 removed
12 unmodified lines13 14 test-coverage:15 @(cd tests; py.test -C $(TESTS))16 17-documentation:18- @(cd docs; ./generate.py)17+html-documentation:18+ @(cd docs; make html)19 20+pdf-documentation:21+ @(cd docs; make latex; cd _build/latex; make all-pdf)22+23 webpage:24 @(cd ../www; ./generate.py)25 26 pylint:1 unmodified line