From c8f8e273496123101477f0d37a42d5558f255c24 Mon Sep 17 00:00:00 2001 From: noah morrison Date: Sat, 29 Nov 2014 17:17:16 -0500 Subject: [PATCH] Update the render doc string --- chevron/renderer.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/chevron/renderer.py b/chevron/renderer.py index dca6b1f..0ee3cbd 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -96,31 +96,48 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache', Renders a mustache template with a data scope and partial capability. Given the file structure... - . - |- main.py - |- main.ms - |- partials - |- part.ms + ╷ + ├─╼ main.py + ├─╼ main.ms + └─┮ partials + └── part.ms then main.py would make the following call: render(open('main.ms', 'r'), {...}, 'partials', 'ms') + Arguments: + template -- A file-like object or a string containing the template + data -- A python dictionary with your data scope + partials_path -- The path to where your partials are stored (defaults to '.') + partials_ext -- The extension that you want the parser to look for (defaults to 'mustache') + partials_dict -- A python dictionary which will be search for partials before the filesystem is. {'include': 'foo'} is the same as a file called include.mustache (defaults to {}) + padding -- This is for padding partials, and shouldn't be used (but can be if you really want to) + def_ldel -- The default left delimiter + ("{{" by default, as in spec compliant mustache) + + def_rdel -- The default right delimiter + ("}}" by default, as in spec compliant mustache) + + scopes -- The list of scopes that get_key will look through + + Returns: + A string containing the rendered template. """ -- 2.47.3