Improved bbcache and documented it.
--HG--
branch : trunk
diff --git a/docs/api.rst b/docs/api.rst
index 41949c8..b939eaa 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -250,7 +250,7 @@
The closest to regular Python behavior is the `StrictUndefined` which
disallows all operations beside testing if it's an undefined object.
-.. autoclass:: jinja2.runtime.Undefined()
+.. autoclass:: jinja2.Undefined()
.. attribute:: _undefined_hint
@@ -278,9 +278,9 @@
:attr:`_undefined_exception` with an error message generated
from the undefined hints stored on the undefined object.
-.. autoclass:: jinja2.runtime.DebugUndefined()
+.. autoclass:: jinja2.DebugUndefined()
-.. autoclass:: jinja2.runtime.StrictUndefined()
+.. autoclass:: jinja2.StrictUndefined()
Undefined objects are created by calling :attr:`undefined`.
@@ -379,22 +379,62 @@
All loaders are subclasses of :class:`BaseLoader`. If you want to create your
own loader, subclass :class:`BaseLoader` and override `get_source`.
-.. autoclass:: jinja2.loaders.BaseLoader
+.. autoclass:: jinja2.BaseLoader
:members: get_source, load
Here a list of the builtin loaders Jinja2 provides:
-.. autoclass:: jinja2.loaders.FileSystemLoader
+.. autoclass:: jinja2.FileSystemLoader
-.. autoclass:: jinja2.loaders.PackageLoader
+.. autoclass:: jinja2.PackageLoader
-.. autoclass:: jinja2.loaders.DictLoader
+.. autoclass:: jinja2.DictLoader
-.. autoclass:: jinja2.loaders.FunctionLoader
+.. autoclass:: jinja2.FunctionLoader
-.. autoclass:: jinja2.loaders.PrefixLoader
+.. autoclass:: jinja2.PrefixLoader
-.. autoclass:: jinja2.loaders.ChoiceLoader
+.. autoclass:: jinja2.ChoiceLoader
+
+
+.. _bytecode-cache:
+
+Bytecode Cache
+--------------
+
+Jinja 2.1 and higher support external bytecode caching. Bytecode caches make
+it possible to store the generated bytecode on the file system or a different
+location to avoid parsing the templates on first use.
+
+This is especially useful if you have a web application that is initialized on
+the first request and Jinja compiles many templates at once which slows down
+the application.
+
+To use a bytecode cache, instanciate it and pass it to the :class:`Environment`.
+
+.. autoclass:: jinja2.BytecodeCache
+ :members: load_bytecode, dump_bytecode, clear
+
+.. autoclass:: jinja2.bccache.Bucket
+ :members: write_bytecode, load_bytecode, bytecode_from_string,
+ bytecode_to_string, reset
+
+ .. attribute:: environment
+
+ The :class:`Environment` that created the bucket.
+
+ .. attribute:: key
+
+ The unique cache key for this bucket
+
+ .. attribute:: code
+
+ The bytecode if it's loaded, otherwise `None`.
+
+
+Builtin bytecode caches:
+
+.. autoclass:: jinja2.FileSystemBytecodeCache
Utilities
@@ -403,13 +443,13 @@
These helper functions and classes are useful if you add custom filters or
functions to a Jinja2 environment.
-.. autofunction:: jinja2.filters.environmentfilter
+.. autofunction:: jinja2.environmentfilter
-.. autofunction:: jinja2.filters.contextfilter
+.. autofunction:: jinja2.contextfilter
-.. autofunction:: jinja2.utils.environmentfunction
+.. autofunction:: jinja2.environmentfunction
-.. autofunction:: jinja2.utils.contextfunction
+.. autofunction:: jinja2.contextfunction
.. function:: escape(s)
@@ -420,11 +460,11 @@
The return value is a :class:`Markup` string.
-.. autofunction:: jinja2.utils.clear_caches
+.. autofunction:: jinja2.clear_caches
-.. autofunction:: jinja2.utils.is_undefined
+.. autofunction:: jinja2.is_undefined
-.. autoclass:: jinja2.utils.Markup([string])
+.. autoclass:: jinja2.Markup([string])
:members: escape, unescape, striptags
.. admonition:: Note
@@ -437,13 +477,13 @@
Exceptions
----------
-.. autoexception:: jinja2.exceptions.TemplateError
+.. autoexception:: jinja2.TemplateError
-.. autoexception:: jinja2.exceptions.UndefinedError
+.. autoexception:: jinja2.UndefinedError
-.. autoexception:: jinja2.exceptions.TemplateNotFound
+.. autoexception:: jinja2.TemplateNotFound
-.. autoexception:: jinja2.exceptions.TemplateSyntaxError
+.. autoexception:: jinja2.TemplateSyntaxError
.. attribute:: message
@@ -466,7 +506,7 @@
unicode strings is that Python 2.x is not using unicode for exceptions
and tracebacks as well as the compiler. This will change with Python 3.
-.. autoexception:: jinja2.exceptions.TemplateAssertionError
+.. autoexception:: jinja2.TemplateAssertionError
.. _writing-filters: