diff options
| author | Chris McDonough <chrism@plope.com> | 2011-06-26 03:46:47 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-06-26 03:46:47 -0400 |
| commit | 8bd6cf291b91977f22d8e153328cc13d38d00ff2 (patch) | |
| tree | dddcf21fc2393b4da7f0a2fc5bd83a7dccbdb6e5 /docs/narr | |
| parent | 311cccf0792233b9312324b0dd56623b929fef96 (diff) | |
| download | pyramid-8bd6cf291b91977f22d8e153328cc13d38d00ff2.tar.gz pyramid-8bd6cf291b91977f22d8e153328cc13d38d00ff2.tar.bz2 pyramid-8bd6cf291b91977f22d8e153328cc13d38d00ff2.zip | |
- Added ``mako.preprocessor`` config file parameter; allows for a Mako
preprocessor to be specified as a Python callable or Python dotted name.
See https://github.com/Pylons/pyramid/pull/183 for rationale.
Closes #183.
Diffstat (limited to 'docs/narr')
| -rw-r--r-- | docs/narr/environment.rst | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/docs/narr/environment.rst b/docs/narr/environment.rst index 3b938c09c..a57b316e1 100644 --- a/docs/narr/environment.rst +++ b/docs/narr/environment.rst @@ -227,11 +227,11 @@ should be changed accordingly. Mako Error Handler ++++++++++++++++++ -Python callable which is called whenever Mako compile or runtime exceptions -occur. The callable is passed the current context as well as the exception. If -the callable returns True, the exception is considered to be handled, else it -is re-raised after the function completes. Is used to provide custom -error-rendering functions. +A callable (or a :term:`dotted Python name` which names a callable) which is +called whenever Mako compile or runtime exceptions occur. The callable is +passed the current context as well as the exception. If the callable returns +True, the exception is considered to be handled, else it is re-raised after +the function completes. Is used to provide custom error-rendering functions. +-----------------------------+ | Config File Setting Name | @@ -290,6 +290,25 @@ default, this is ``false``. | | +-----------------------------+ +Mako Preprocessor ++++++++++++++++++ + +A callable (or a :term:`dotted Python name` which names a callable) which is +called to preprocess the source before the template is called. The callable +will be passed the full template source before it is parsed. The return +result of the callable will be used as the template source code. + +.. note:: This feature is new in Pyramid 1.1. + ++-----------------------------+ +| Config File Setting Name | ++=============================+ +| ``mako.preprocessor`` | +| | +| | +| | ++-----------------------------+ + Examples -------- |
