Skip to content
Myr

added style for html 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 b5f522c · Browse files · 15 files+480 added−232 removed
This commit

State

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

Diff stats

15 files+480 added−232 removed

  • other:+480 added−232 removed

15 files+480 added−232 removed

added:docs/_static/headerbg.pngbinary

A binary file, added.

added:docs/_static/jinjabanner.pngbinary

A binary file, added.

added:docs/_static/style.css+256 added
1body {2 background-color: #333;3 margin: 0;4 padding: 0;5 font-family: 'Georgia', serif;6 font-size: 15px;7 color: #eee;8}910div.footer {11 padding: 5px;12 text-align: center;13}1415div.footer a {16 color: #eee;17}1819div.header {20 background: url(headerbg.png) repeat-x;21 border-top: 6px solid #D20000;22 border-bottom: 1px solid #ACACAC;23 margin: -10px -10px 0 -10px;24}2526div.relnav {27 border-top: 1px solid #F1F1F1;28 border-bottom: 1px solid #ACACAC;29 background-color: #ECECEC;30 padding: 4px 20px 4px 28px;31 margin: 0 -10px 10px -10px;32 font-size: 13px;33}3435#content {36 background-color: white;37 color: #111;38 background-image: url(watermark.png);39 padding: 10px;40 margin: 0;41}4243h1.heading {44 margin: 0;45 padding: 0;46 height: 80px;47 background-image: url(jinjabanner.png);48 background-repeat: no-repeat;49}5051h1.heading a {52 display: block;53 width: 200px;54 height: 80px;55}5657h1.heading span {58 display: none;59}6061h2.subheading {62 margin: -55px 0 35px 200px;63 font-weight: normal;64 font-size: 30px;65 color: #444;66}6768h2.plain {69 margin: 0;70}7172#jinjalogo {73 background-image: url(jinjalogo.png);74 background-repeat: no-repeat;75 width: 400px;76 height: 160px;77}7879#contentwrapper {80 max-width: 700px;81 padding: 0 0 20px 18px;82}8384#contentwrapper h3,85#contentwrapper h3 a {86 color: #b41717;87 font-size: 26px;88 margin: 20px 0 0 -5px;89}9091#contentwrapper h4,92#contentwrapper h4 a {93 color: #b41717;94 font-size: 20px;95 margin: 20px 0 0 0;96}9798table.docutils {99 border-collapse: collapse;100 border: 2px solid #aaa;101 margin: 0.5em 1.5em 0.5em 1.5em;102}103104table.docutils td {105 padding: 2px;106 border: 1px solid #ddd;107}108109p, li, dd, dt, blockquote {110 color: #333;111}112113p {114 line-height: 150%;115 margin-bottom: 0;116 margin-top: 10px;117 text-align: justify;118}119120hr {121 border-top: 1px solid #ccc;122 border-bottom: 0;123 border-right: 0;124 border-left: 0;125 margin-bottom: 10px;126 margin-top: 20px;127}128129dl {130 margin-left: 10px;131}132133li, dt {134 margin-top: 5px;135}136137dt {138 font-weight: bold;139}140141th {142 text-align: left;143 padding: 3px;144 background-color: #f2f2f2;145}146147a {148 color: #b41717;149}150151a:hover {152 color: #444;153}154155pre {156 background-color: #f9f9f9;157 border-top: 1px solid #ccc;158 border-bottom: 1px solid #ccc;159 padding: 5px;160 font-size: 13px;161 font-family: 'Bitstream Vera Sans Mono', 'Monaco', monospace;162}163164tt {165 font-size: 13px;166 font-family: 'Bitstream Vera Sans Mono', 'Monaco', monospace;167 color: black;168 padding: 1px 2px 1px 2px;169 background-color: #f0f0f0;170}171172cite {173 /* abusing <cite>, it's generated by ReST for `x` */174 font-size: 13px;175 font-family: 'Bitstream Vera Sans Mono', 'Monaco', monospace;176 font-weight: bold;177 font-style: normal;178}179180div.admonition {181 margin: 10px 0 10px 0;182 padding: 10px;183 border: 1px solid #ccc;184 background-color: #f8f8f8;185}186187div.admonition p.admonition-title {188 margin: -3px 0 5px 0;189 font-weight: bold;190 color: #b41717;191 font-size: 16px;192}193194div.admonition p {195 margin: 0 0 0 40px;196}197198#toc {199 margin: 20px -10px 10px 15px;200 padding: 10px;201 width: 200px;202 float: right;203 background-color: #f8f8f8;204 border: 1px solid #ccc;205 border-right: none;206}207208#toc h3 {209 font-size: 20px;210 margin: 0 0 10px 0;211 padding: 0;212 color: #444;213}214215#toc ul {216 margin: 0 0 0 30px;217 padding: 0;218}219220#toc ul li {221 padding: 0;222 margin: 2px 0 2px 0;223}224225a.headerlink {226 color: #A70000;227 font-size: 0.8em;228 margin-left: 8px;229 padding: 0 4px 0 4px;230 text-decoration: none!important;231 visibility: hidden;232}233234h1:hover > a.headerlink,235h2:hover > a.headerlink,236h3:hover > a.headerlink,237h4:hover > a.headerlink,238h5:hover > a.headerlink,239h6:hover > a.headerlink,240dt:hover > a.headerlink {241 visibility: visible;242}243244a.headerlink:hover {245 background-color: #A70000;246 color: white!important;247}248249table.indextable {250 width: 100%;251}252253table.indextable td {254 vertical-align: top;255 width: 50%;256}
added:docs/_static/watermark.pngbinary

A binary file, added.

added:docs/_templates/genindex.html+44 added
added:docs/_templates/layout.html+72 added
added:docs/_templates/opensearch.xml+9 added
1<?xml version="1.0" encoding="UTF-8"?>2<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">3 <ShortName>{{ project }}</ShortName>4 <Description>Search {{ docstitle }}</Description>5 <InputEncoding>utf-8</InputEncoding>6 <Url type="text/html" method="get"7 template="{{ use_opensearch }}/{{ pathto('search') }}?q={searchTerms}&amp;check_keywords=yes&amp;area=default"/>8 <LongName>{{ docstitle }}</LongName>9</OpenSearchDescription>
added:docs/_templates/page.html+4 added
added:docs/_templates/search.html+35 added
added:docs/changelog.rst+4 added
1Changelog2=========34.. jinjachangelog::
modified:docs/conf.py+5 added-9 removed
74 unmodified lines
7576# The style sheet to use for HTML and HTML Help pages. A file of that name77# must exist either in Sphinx' static/ path, or in one of the custom paths78# given in html_static_path.79html_style = 'default.css'79html_style = 'style.css'8081# The name for this set of Sphinx documents. If None, it defaults to82# "<project> v<release> documentation".83#html_title = None
10 unmodified lines
94# If true, SmartyPants will be used to convert quotes and dashes to95# typographically correct entities.96#html_use_smartypants = True9798# Custom sidebar templates, maps document names to template names.99#html_sidebars = {}98# use jinja2 for templates99template_bridge = 'jinjaext.Jinja2Bridge'100101# Additional templates that should be rendered to pages, maps page names to102# template names.103#html_additional_pages = {}101# no modindex102html_use_modindex = False103105# If false, no module index is generated.106#html_use_modindex = True107104# If true, the reST sources are included in the HTML build as _sources/<name>.105#html_copy_source = True106107# If true, an OpenSearch description file will be output, and all pages will
37 unmodified lines
modified:docs/index.rst+7 added-3 removed
1Welcome to Jinja2's documentation!2==================================1Jinja2 Documentation2====================34Contents:4Welcome in the Jinja2 documentation.56.. toctree::7 :maxdepth: 289 intro10 api11 templates1213 changelog1415* :ref:`genindex`
modified:docs/jinjaext.py+39 added-2 removed
6 unmodified lines
78 :copyright: Copyright 2008 by Armin Ronacher.9 :license: BSD.10"""11import os12import re13import inspect14import jinja215from itertools import islice16from types import BuiltinFunctionType17from docutils import nodes18from docutils.statemachine import ViewList19from sphinx.ext.autodoc import prepare_docstring171820from sphinx.application import TemplateBridge21from pygments.style import Style22from pygments.token import Keyword, Name, Comment, String, Error, \23 Number, Operator, Generic24from jinja2 import Environment, FileSystemLoader252627class JinjaStyle(Style):28 title = 'Jinja Style'
33 unmodified lines
6263 Error: '#F00 bg:#FAA'64 }656667class Jinja2Bridge(TemplateBridge):6869 def init(self, builder):70 path = builder.config.templates_path71 self.env = Environment(loader=FileSystemLoader(path))7273 def render(self, template, context):74 return self.env.get_template(template).render(context)757677_sig_re = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*(\(.*?\))')787980def format_function(name, aliases, func):
44 unmodified lines
125 return node.children126 return directive127128129def jinja_changelog(dirname, arguments, options, content, lineno,130 content_offset, block_text, state, state_machine):131 doc = ViewList()132 changelog = file(os.path.join(os.path.dirname(jinja2.__file__), '..',133 'CHANGES'))134 try:135 for line in islice(changelog, 3, None):136 doc.append(line.rstrip(), '<jinjaext>')137 finally:138 changelog.close()139 node = nodes.section()140 # hack around title style bookkeeping141 surrounding_title_styles = state.memo.title_styles142 surrounding_section_level = state.memo.section_level143 state.memo.title_styles = []144 state.memo.section_level = 0145 state.nested_parse(doc, content_offset, node, match_titles=1)146 state.memo.title_styles = surrounding_title_styles147 state.memo.section_level = surrounding_section_level148 return node.children149150151from jinja2.defaults import DEFAULT_FILTERS, DEFAULT_TESTS152jinja_filters = dump_functions(DEFAULT_FILTERS)153jinja_tests = dump_functions(DEFAULT_TESTS)154155156def setup(app):157 app.add_directive('jinjafilters', jinja_filters, 0, (0, 0, 0))158 app.add_directive('jinjatests', jinja_tests, 0, (0, 0, 0))159 app.add_directive('jinjachangelog', jinja_changelog, 0, (0, 0, 0))
modified:.hgignore+1 added-1 removed
1^instance$2^instance/3^jinja2/.*\.so$4^docs/_.*4^docs/_build5^(build|dist|Jinja2\.egg-info)/6\.py[co]$7\.DS_Store$
modified:CHANGES+4 added-217 removed
1Jinja Changelog1Jinja2 Changelog2===============34Version 1.34Version 2.05-----------6(codename to be selected, release around February 2007)6(codename to be selected, release around July 2008)78Version 1.29-----------10(codename to be hatsuyuki, released Nov 17th 2007)1112.. admonition:: Backwards Incompatible Changes1314 - `call` is a keyword now15 - the internal parser AST changed16 - `extends` must be the first tag in a template17 - the tuple literal yields tuples now, instead of lists.1819- environments now have a `translator_factory` parameter that allows20 to change the translator without subclassing the environment.2122- fixed bug in buffet plugin regarding the package loader2324- once again improved debugger.2526- added `groupby` filter.2728- added `sameas` test function.2930- standalone parser. Jinja does not use the python parser any more and will31 continue having the same semantics in any future python versions. This32 was done in order to simplify updating Jinja to 2.6 and 3.0 and to support33 non python syntax.3435- added support for ``expr1 if test else expr2`` (conditional expressions)3637- ``foo.0`` as alias for ``foo[0]`` is possible now. This is mainly for38 django compatibility.3940- the filter operators has a much higher priority now which makes it41 possible to do ``foo|filter + bar|filter``.4243- new AST. the return value of `Environment.parse` is now a Jinja AST and not44 a Jinja-Python AST. This is also the only backwards incompatible change but45 should not affect many users because this feature is more or less46 undocumented and has few use cases.4748- tuple syntax returns tuples now and not lists any more.4950- the print directive and ``{{ variable }}`` syntax now accepts and implicit51 tuple like the `for` and `cycle` tags. (``{{ 1, 2 }}`` is an implicit alias52 for ``{{ (1, 2) }}` like ``{% for a, b in seq %}`` is for53 ``{% for (a, b) in seq %}``.5455- tests called with *one* parameter don't need parentheses. This gives a more56 natural syntax for the `sameas` test and some others:57 ``{{ foo is sameas bar }}`` instead of ``{{ foo is sameas(bar) }}``. If you58 however want to pass more than one argument you have to use parentheses59 because ``{{ foo is sometest bar, baz }}`` is handled as60 ``{{ (foo is sometest(bar), baz) }}``, so as tuple expression.6162- removed support for octal character definitions in strings such as63 ``'\14'``, use ``'\x0c'`` now.6465- added regular expression literal. ``@/expr/flags`` equals66 ``re.compile(r'(?flags)expr')``. This is useful for the `matching` test and67 probably some others.6869- added set literal. We do not use python3's {1, 2} syntax because70 this conflicts with the dict literal. To be compatible with the regex71 literal we use ``@(1, 2)`` instead.7273- fixed bug in `get_attribute` that disallowed retreiving attributes of objects74 without a `__class__` such as `_sre.SRE_Pattern`.7576- addded `django.contrib.jinja` which provides advanced support for django.77 (thanks Bryan McLemore)7879- debugger is now able to rewrite the whole traceback, not only the first80 frame. (requires the optional debugger c module which is compiled81 automatically on installation if possible)8283- if the set that is postfixed with a bang (!) it acts like the python 384 "nonlocal" keyword. This means that you can now override variables85 defined in the outer scope from within a loop.8687- ``foo ~ bar`` is now a simpler alternative to ``foo|string + bar|string``8889- `PackageLoader` can now work without pkg_resources too9091- added `getattribute` and `getitem` filter.9293- added support for the `pretty` library.9495- changed the way the `MemcachedLoaderMixin` creates the class so that it's96 possible to hook your own client in.979899Version 1.1100-----------101(codename: sinka, released Jun 1, 2007)102103- blocks now support ``{{ super() }}`` to render the parent output.104105- debugging system improved, smaller filesize for the cached files.106 Debugging works now well for any module using linecache.107108- ``{{ debug() }}`` can now be used to get a list of filters and109 tags.110111- the template lexer keeps not track of brace, parenthesis and112 bracket balance in order to not break variable tags apart if they113 are configured to look like this: ``${expr}``. This also fixes114 the problem with nested dicts in variable expressions.115116- it's now possible to configure the variable blocks to look the117 same as the block delimiters. Thus you can set the syntax to something118 like ``{ / }`` for both blocks and variables.119120- added whitespace management system for the template designer.121122- some small bugfixes.123124- improved security system regarding function calls and variable125 assignment in for loops.126127- added `lipsum` function to generate random text.128129- strings without unicode characters are processed as binary strings now130 to workaround problems with `datetime.strftime` which only accepts131 binary strings.132133- it's now possible to use newlines in string literals134135- developer friendly traceback is now toggleable136137- the variable failure is now pluggable by replacing the undefined138 singleton for an environment instance139140- fixed issue with old-style classes not implementing `__getitem__`141 (thanks to Axel Böhm for discovering that bug)142143- added a bunch of new docstrings to the Jinja classes. Makes fun now to144 use pydoc :-)145146- fixed severe memcaching bug. Formerly it wasn't possible to use memcaching147 without enabling disk cache.148149- fixed a bug that allowed users to override the special names `_`, `true` etc.150151- added `batch` and `slice` filters for batching or slicing sequences152153- added `sum`, `abs`, `round` and `sort` filters. This fixes #238154155- added `striptags` and `xmlattr` filters for easier SGML/XML processing156157- the trans tag does not need explicit naming for variables with the same158 name any more. You can now use ``{% trans foo %}`` instead of the verbose159 version ``{% trans foo=foo %}``.160161- reimplemented Buffet plugin so that it works at least for pylons162163- added `Environment.get_translations_for_string`164165- fixed a bug in the parser that didn't unescape keyword arguments. (thanks166 to Alexey Melchakov for reporting)167168- You can now use the environment to just tokenize a template. This can169 be useful for syntax highlighting or other purposes.170171- added optional C-implementation of the context baseclass.172173- you can now use optional parentheses around macro defintions. Thus it's174 possible to write ``{% macro foo(a, b, c) %}`` instead of ``{% macro175 foo a, b, c %}``.176177- additional macro arguments now end up in `varargs`.178179- implemented the `{% call %}` block. `call` and `endcall` can still be used180 as identifiers until Jinja 1.3181182- it's now possible to stream templates.183184- fixed a corner case when defining a block inside of a condition185186- the cached loader mixin is now able to cache multiple templates from187 different loaders in the same cache folder.188189- Translatable strings returned by ``_()`` will leave their string formatting190 signs untouched. Thanks to Stefan Ebner for reporting.191192- ``{% block name "data" %}`` is now an alias for193 ``{% block name %}data{% endblock %}``. Note that the second argument can194 be an expression. As soon as you specify an expression as second argument195 the closing tag has to be omitted.196197- It's now possible to iterate over iterators additionally to sequences.198 If the iterator is inifite it will crash however, so makes sure you don't199 pass something like that to a template!200201- added `rendetemplate` to render included templates in an isolated202 environment and get the outout back.203204- added `simplefilter` decorator.205206- improved ChoiceLoader error reporting (thanks to Bryan McLemore)207208- fixed extended slicing209210- reworked loader layer. All the cached loaders now have "private" non cached211 baseclasses so that you can easily mix your own caching layers in.212213- added `MemcachedLoaderMixin` and `MemcachedFileSystemLoader` contributed214 by Bryan McLemore.215216217Version 1.0218-----------219(codename: siyutusan, released Mar 23, 2007)220221- Initial release8- initial release of Jinja2