Merge pull request #2926 from DjSlash/update-ifdef-doc

Usage of %ifdef in more detail, closes #2925
This commit is contained in:
Adrian Sampson 2018-05-13 09:34:30 -04:00 committed by GitHub
commit 749b511ab2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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