Skip to content
This repository
Browse code

Adding Mako environment variables.

  • Loading branch information...
commit 7d01c60c6190ca5edba9710e09799280a059efae 1 parent 66fcbf6
Ben Bangert bbangert authored

Showing 2 changed files with 65 additions and 0 deletions. Show diff stats Hide diff stats

  1. +61 0 docs/narr/environment.rst
  2. +4 0 docs/narr/views.rst
61 docs/narr/environment.rst
Source Rendered
@@ -140,6 +140,67 @@ The value supplied here is used as the default locale name when a
140 140 | | |
141 141 +---------------------------------+-----------------------------+
142 142
  143 +.. _mako_template_renderer_settings:
  144 +
  145 +Mako Template Render Settings
  146 +-----------------------------
  147 +
  148 +Mako derives additional settings to configure its template renderer that
  149 +should be set when using it. Many of these settings are optional and only need
  150 +to be set if they should be different from the default. The Mako Template
  151 +Renderer uses a subclass of Mako's `template lookup
  152 +<http://www.makotemplates.org/docs/usage.html#usage_lookup>`_ and accepts
  153 +several arguments to configure it.
  154 +
  155 +Mako Directories
  156 +++++++++++++++++
  157 +
  158 +The value(s) supplied here are passed in as the template directories. They
  159 +should be in :term:`resource specification` format, for example:
  160 +``my.package:templates``.
  161 +
  162 ++-----------------------------+
  163 +| Config File Setting Name |
  164 ++=============================+
  165 +| ``mako.directories`` |
  166 +| |
  167 +| |
  168 +| |
  169 ++-----------------------------+
  170 +
  171 +Mako Module Directory
  172 ++++++++++++++++++++++
  173 +
  174 +The value supplied here tells Mako where to store compiled Mako templates. If
  175 +omitted, compiled templates will be stored in memory. This value should be an
  176 +absolute path, for example: ``%(here)s/data/templates`` would use a directory
  177 +called ``data/templates`` in the same parent directory as the INI file.
  178 +
  179 ++-----------------------------+
  180 +| Config File Setting Name |
  181 ++=============================+
  182 +| ``mako.module_directory`` |
  183 +| |
  184 +| |
  185 +| |
  186 ++-----------------------------+
  187 +
  188 +Mako Input Encoding
  189 ++++++++++++++++++++
  190 +
  191 +The encoding that Mako templates are assumed to have. By default this is set
  192 +to ``utf-8``. If you wish to use a different template encoding, this value
  193 +should be changed accordingly.
  194 +
  195 ++-----------------------------+
  196 +| Config File Setting Name |
  197 ++=============================+
  198 +| ``mako.input_encoding``__ |
  199 +| |
  200 +| |
  201 +| |
  202 ++-----------------------------+
  203 +
143 204 Examples
144 205 --------
145 206
4 docs/narr/views.rst
Source Rendered
@@ -614,6 +614,10 @@ specification`:
614 614 renderer="some.package:templates/foo.mak"
615 615 />
616 616
  617 +The ``Mako`` template renderer can take additional arguments beyond the
  618 +standard ``reload_templates`` setting, see the :ref:`environment_chapter` for
  619 +additional :ref:`mako_template_renderer_settings`.
  620 +
617 621 .. index::
618 622 single: response headers (from a renderer)
619 623 single: renderer response headers

0 comments on commit 7d01c60

Please sign in to comment.
Something went wrong with that request. Please try again.