Debian Codegraph @

docs/plugins/the.rst

raw
1 The Plugin
2 ==========
3
4 The ``the`` plugin allows you to move patterns in path formats. It's suitable,
5 for example, for moving articles from string start to the end. This is useful
6 for quick search on filesystems and generally looks good. Plugin does not change
7 tags. By default plugin supports English "the, a, an", but custom regexp
8 patterns can be added by user. How it works:
9
10 ::
11
12 The Something -> Something, The
13 A Band -> Band, A
14 An Orchestra -> Orchestra, An
15
16 To use the ``the`` plugin, enable it (see :doc:`/plugins/index`) and then use a
17 template function called ``%the`` in path format expressions:
18
19 ::
20
21 paths:
22 default: %the{$albumartist}/($year) $album/$track $title
23
24 The default configuration moves all English articles to the end of the string,
25 but you can override these defaults to make more complex changes.
26
27 Configuration
28 -------------
29
30 To configure the plugin, make a ``the:`` section in your configuration file. The
31 available options are:
32
33 - **a**: Handle "A/An" moves. Default: ``yes``.
34 - **the**: handle "The" moves. Default: ``yes``.
35 - **patterns**: Custom regexp patterns, space-separated. Custom patterns are
36 case-insensitive regular expressions. Patterns can be matched anywhere in the
37 string (not just the beginning), so use ``^`` if you intend to match leading
38 words. Default: ``[]``.
39 - **strip**: Remove the article altogether instead of moving it to the end.
40 Default: ``no``.
41 - **format**: A Python format string for the output. Use ``{0}`` to indicate the
42 part without the article and ``{1}`` for the article. Spaces are already
43 trimmed from ends of both parts. Default: ``'{0}, {1}'``.