From 13fd31dd87525ac8310bedfa1060d2b2a3ba9f96 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 13 Jan 2011 13:05:11 +0000 Subject: [PATCH] Slight change to the dialog --- src/calibre/gui2/preferences/template_functions.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/preferences/template_functions.ui b/src/calibre/gui2/preferences/template_functions.ui index 8227c92607..2662d50dd7 100644 --- a/src/calibre/gui2/preferences/template_functions.ui +++ b/src/calibre/gui2/preferences/template_functions.ui @@ -29,7 +29,7 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Here you can add and remove functions used in template processing. A template function is writen in python. It takes information from the book, processes it in some way, then returns a string result. Functions defined here are usable in templates in the same way that builtin functions are usable. The function must be named </span><span style=" font-size:8pt; font-weight:600;">evaluate</span><span style=" font-size:8pt;">, and must have the signature shown below. </span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">evaluate(self, formatter, kwargs, mi, locals, your_arguments)</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">evaluate(self, formatter, kwargs, mi, locals, your_arguments) </span><span style=" font-size:8pt;">returning a</span><span style=" font-size:8pt; font-weight:600;"> unicode </span><span style=" font-size:8pt;">string</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">The arguments to evaluate are:</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">- formatter: the instance of the formatter being used to evaluate the current template. You can use this to do recursive template evaluation.</span></p>