From 8849f5adecbb2dc3bdd75dc99f0e2f288a4f0977 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Oct 2020 13:45:23 +0530 Subject: [PATCH] String changes --- Changelog.yaml | 2 +- manual/template_lang.rst | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Changelog.yaml b/Changelog.yaml index aab68ccc22..f13356f3d1 100644 --- a/Changelog.yaml +++ b/Changelog.yaml @@ -26,7 +26,7 @@ new features: - title: "Tag browser: When grouping items by first letter if adjacent letters have few entries combine them into a single group." - description: "Can be controlled via an option in Preferences->Look & fee->Tag browser to combine 'first letters' together if there are a small number of items under adjacent letters" + description: "Can be controlled via an option in Preferences->Look & feel->Tag browser to combine 'first letters' together if there are a small number of items under adjacent letters" - title: "Viewer: Allow displaying the current page / total pages in the header/footer. Useful in paged mode to see exactly how many pages are left." tickets: [1899163] diff --git a/manual/template_lang.rst b/manual/template_lang.rst index 39598bcce6..18e1604c0e 100644 --- a/manual/template_lang.rst +++ b/manual/template_lang.rst @@ -433,7 +433,7 @@ of programming language bits. For example, the value of the column is always pas to a function included in the template. SFM also doesn't support the difference between variables and strings; all values are strings. -Example: the following SFM template returns either the series name of the string "no series":: +Example: the following SFM template returns either the series name or the string "no series":: {series:ifempty(no series)} @@ -442,14 +442,15 @@ The equivalent templates in TPM and GPM are:: TPM: ``{series:'ifempty($, 'no series')'} GPM: ``program: ifempty(field('series'), 'no series')`` -The first argument to ifempty is the value of the field ``series`` and the second argument -is the string ``no series``. In SFM the first argument, the value, is automatically passed (the invisible argument). +The first argument to ``ifempty`` is the value of the field ``series`` and the second argument +is the string ``no series``. In SFM the first argument, the value, +is automatically passed (the invisible argument). Several template functions, for example ``booksize()`` and ``current_library_name()``, take no arguments. Because of the 'invisible argument' you cannot use these functions in SFM. Nested functions, where a function calls another function to compute an argument, cannot be used in SFM. -For example this template, intended to return the the first 5 characters of the series value uppercased, won't work in SFM:: +For example this template, intended to return the first 5 characters of the series value uppercased, won't work in SFM:: {series:uppercase(substr(0,5))}