From 8148c9e265ab22f4b67ed0e67244b338cd8517ae Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 23 Oct 2020 17:22:00 -0700 Subject: [PATCH] Document render_template(templates) list, closes #1045 --- docs/internals.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/internals.rst b/docs/internals.rst index 95bdfc68..e09e932f 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -193,9 +193,11 @@ This method lets you read plugin configuration values that were set in ``metadat await .render_template(template, context=None, request=None) ------------------------------------------------------------ -``template`` - string +``template`` - string or list of strings The template file to be rendered, e.g. ``my_plugin.html``. Datasette will search for this file first in the ``--template-dir=`` location, if it was specified - then in the plugin's bundled templates and finally in Datasette's set of default templates. + If this is a list of template file names then the first one that exists will be rendered. + ``context`` - None or a Python dictionary The context variables to pass to the template.