String changes

This commit is contained in:
Kovid Goyal 2021-05-03 13:47:46 +05:30
parent 889b5f556f
commit f4bfb45601
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 12 additions and 12 deletions

View File

@ -110,7 +110,7 @@ Other options
:alt: Other options
:align: center
:guilabel:`Catalog cover` specifies whether to generate a new cover or use an existing cover. It is possible to create a custom cover for your catalogs - see :ref:`Custom catalog covers` for more information. If you have created a custom cover that you want to reuse, select :guilabel:`Use existing cover`. Otherwise, select :guilabel:`Generate new cover`.
:guilabel:`Catalog cover` specifies whether to generate a new cover or use an existing cover. It is possible to create a custom cover for your catalogs - see :ref:`custom_catalog_covers` for more information. If you have created a custom cover that you want to reuse, select :guilabel:`Use existing cover`. Otherwise, select :guilabel:`Generate new cover`.
:guilabel:`Extra Description note` specifies a custom column's contents to be inserted into the Description page, next to the cover thumbnail. For example, you might want to display the date you last read a book using a :guilabel:`Last Read` custom column. For advanced use of the Description note feature, see `this post in the calibre forum <https://www.mobileread.com/forums/showpost.php?p=1335767&postcount=395>`_.
@ -118,7 +118,7 @@ Other options
:guilabel:`Merge with comments` specifies a custom column whose content will be non-destructively merged with the comments metadata during catalog generation. For example, you might have a custom column :guilabel:`Author bio` that you'd like to append to the comments metadata. You can choose to insert the custom column contents *before or after* the comments section, and optionally separate the appended content with a horizontal rule separator. Eligible custom column types include ``text, comments, and composite``.
.. _Custom catalog covers:
.. _custom_catalog_covers:
Custom catalog covers
-----------------------

View File

@ -1,10 +1,10 @@
.. _dmr:
.. _drm:
Digital Rights Management (DRM)
===============================================
Digital rights management (DRM) is a generic term for access control
Digital Rights Management (DRM) is a generic term for access control
technologies that can be used by hardware manufacturers, publishers, copyright
holders and individuals to try to impose limitations on the usage of digital
content and devices. It is also, sometimes, disparagingly described as Digital

View File

@ -13,7 +13,7 @@ The calibre template language is a calibre-specific language used throughout cal
The language is built around the notion of a `template`, which specifies which book metadata to use, computations on that metadata, and how it is to be formatted.
Basic Templates
Basic templates
---------------
A basic template consists one or more ``template expressions``. A ``template expression`` consists of text and names in curly brackets (``{}``) that is replaced by the corresponding metadata from the book being processed. For example, the default template in calibre used for saving books to device has 4 ``template expressions``::
@ -254,7 +254,7 @@ Notes:
* Strings and numbers can be used interchangeably. For example, ``10`` and ``'10'`` are the same thing.
* Comments are lines starting with a '#' character. Comments beginning later in a line are not supported.
**Operator Precedence**
**Operator precedence**
The operator precedence (order of evaluation) from highest (evaluated first) to lowest (evaluated last) is:
@ -269,7 +269,7 @@ The operator precedence (order of evaluation) from highest (evaluated first) to
* Logical and (``&&``). This operator returns '1' if both the left-hand and right-hand expressions are True, or the empty string ``''`` if either is False. It is associative, evaluates left to right, and does `short-circuiting <https://chortle.ccsu.edu/java5/Notes/chap40/ch40_2.html>`_.
* Logical or (``||``). This operator returns ``'1'`` if either the left-hand or right-hand expression is True, or ``''`` if both are False. It is associative, evaluates left to right, and does `short-circuiting <https://chortle.ccsu.edu/java5/Notes/chap40/ch40_2.html>`_. It is an `inclusive or`, returning ``'1'`` if both the left- and right-hand expressions are True.
**Field References**
**Field references**
A ``field_reference`` evaluates to the value of the metadata field named by lookup name that follows the ``$`` or ``$$``. Using ``$`` is equivalent to using the ``field()`` function. Using ``$$`` is equivalent to using the ``raw_field`` function. Examples::
@ -278,7 +278,7 @@ A ``field_reference`` evaluates to the value of the metadata field named by look
* $$pubdate ==> raw_field('pubdate')
* $$#my_int ==> raw_field('#my_int')
**If Expressions**
**If expressions**
``If`` expressions first evaluate the ``condition``. If the ``condition`` is True (a non-empty value) then the ``expression_list`` in the ``then`` clause is evaluated. If it is False then if present the ``expression_list`` in the ``elif`` or ``else`` clause is evaluated. The ``elif`` and ``else`` parts are optional. The words ``if``, ``then``, ``elif``, ``else``, and ``fi`` are reserved; you cannot use them as identifier names. You can put newlines and white space wherever they make sense. The ``condition`` is a ``top_expression`` not an ``expression_list``; semicolons are not allowed. The ``expression_lists`` are semicolon-separated sequences of ``top_expressions``. An ``if`` expression returns the result of the last ``top_expression`` in the evaluated ``expression_list``, or the empty string if no expression list was evaluated.
@ -318,7 +318,7 @@ As a last example, this program returns the value of the ``series`` column if th
program: field(if field('series') then 'series' else 'title' fi)
**For Expressions**
**For expressions**
The ``for`` expression iterates over a list of values, processing them one at a time. The ``list_expression`` must evaluate to either a metadata field ``lookup name``, for example ``tags`` or ``#genre``, or a list of values. If the result is a valid ``lookup name`` then the field's value is fetched and the separator specified for that field type is used. If the result isn't a valid lookup name then it is assumed to be a list of values. The list is assumed to be separated by commas unless the optional keyword ``separator`` is supplied, in which case the list values must be separated by the result of evaluating the ``separator_expr``. Each value in the list is assigned to the specified variable then the ``expression_list`` is evaluated. You can use ``break`` to jump out of the loop, and ``continue`` to jump to the beginning of the loop for the next iteration.
@ -337,7 +337,7 @@ If the original Genre is `History.Military, Science Fiction.Alternate History, R
Note: the last line in the template, ``new_tags``, isn't strictly necessary in this case because ``for`` returns the value of the last top_expression in the expression list. The value of an assignment is the value of its expression, so the value of the ``for`` statement is what was assigned to ``new_tags``.
**Relational Operators**
**Relational operators**
Relational operators return ``'1'`` if the comparison is true, otherwise the empty string ('').
@ -360,7 +360,7 @@ Examples:
* ``program: if 11 > 2 then 'yes' else 'no' fi`` returns ``'no'`` because the ``>`` operator does a lexical comparison.
* ``program: if 11 ># 2 then 'yes' else 'no' fi`` returns ``'yes'`` because the ``>#`` operator does a numeric comparison.
**Additional Available Functions**
**Additional available functions**
The following functions are available in addition to those described in :ref:`Single Function Mode <single_mode>`.
@ -530,7 +530,7 @@ In `TPM`, using ``{`` and ``}`` characters in string literals can lead to errors
As with `General Program Mode`, for functions documented under :ref:`Single Function Mode <single_mode>` you must supply the value the function is to act upon as the first parameter in addition to the documented parameters. In `TPM` you can use ``$`` to access the value specified by the ``lookup name`` for the template expression.
Stored General Program Mode Templates
Stored general program mode templates
----------------------------------------
:ref:`General Program Mode <general_mode>` supports saving templates and calling those templates from another template, much like calling stored functions. You save templates using :guilabel:`Preferences->Advanced->Template functions`. More information is provided in that dialog. You call a template the same way you call a function, passing positional arguments if desired. An argument can be any expression. Examples of calling a template, assuming the stored template is named ``foo``: