Usage of %ifdef in more detail, closes #2925

This commit is contained in:
Rutger van Sleen 2018-05-13 11:16:49 +02:00
parent 24d5188147
commit 85df4f513d

View file

@ -83,9 +83,11 @@ These functions are built in to beets:
``%first{text,count,skip,sep,join}`` where ``sep`` is the separator, like
``;`` or ``/`` and join is the text to concatenate the items.
* ``%ifdef{field}``, ``%ifdef{field,truetext}`` or
``%ifdef{field,truetext,falsetext}``: If ``field`` exists, then return
``truetext`` or ``field`` (default). Otherwise, returns ``falsetext``.
The ``field`` should be entered without ``$``.
``%ifdef{field,truetext,falsetext}``: Checks if an flexible attribute
``field`` is defined. If it exists, then return ``truetext`` or ``field``
(default). Otherwise, returns ``falsetext``. The ``field`` should be entered
without ``$``. Note that this doesn't work with built-in :ref:`itemfields`, as
they are always defined.
.. _unidecode module: http://pypi.python.org/pypi/Unidecode
.. _strftime: http://docs.python.org/2/library/time.html#time.strftime