From 97a0ae8a3e74c7e1b222b07af33ade8baf7563f0 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 13 Jan 2011 18:30:27 +0000 Subject: [PATCH] Add a paragraph to template_lang.rst. Change slightly the template_dialog upper text. --- src/calibre/gui2/preferences/template_functions.py | 3 ++- src/calibre/manual/template_lang.rst | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/preferences/template_functions.py b/src/calibre/gui2/preferences/template_functions.py index 8416c5a581..fa15c0a973 100644 --- a/src/calibre/gui2/preferences/template_functions.py +++ b/src/calibre/gui2/preferences/template_functions.py @@ -38,7 +38,8 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): This parameter can be None in some cases, such as when evaluating non-book templates.
  • locals: the local variables assigned to by the current - template program. Your_arguments must be one or more parameter (number + template program.
  • +
  • Your_arguments must be one or more parameter (number matching the arg count box), or the value *args for a variable number of arguments. These are values passed into the function. One argument is required, and is usually the value of the field being operated upon. diff --git a/src/calibre/manual/template_lang.rst b/src/calibre/manual/template_lang.rst index f64a413d3e..f63a7c4e95 100644 --- a/src/calibre/manual/template_lang.rst +++ b/src/calibre/manual/template_lang.rst @@ -308,6 +308,12 @@ The following program produces the same results as the original recipe, using on It would be possible to do the above with no custom columns by putting the program into the template box of the plugboard. However, to do so, all comments must be removed because the plugboard text box does not support multi-line editing. It is debatable whether the gain of not having the custom column is worth the vast increase in difficulty caused by the program being one giant line. + +User-defined Template Functions +------------------------------- + +You can add your own functions to the template processor. Such functions are written in python, and can be used in any of the three template programming modes. The functions are added by going to Preferences -> Advanced -> Template Functions. Instructions are shown in that dialog. + Special notes for save/send templates -------------------------------------