beets/docs
Šarūnas Nejus 65e935bee5
Perform a regex substitution in the substitute plugin (#5357)
This utilises regex substitution in the substitute plugin. The previous
approach only used regex to match the pattern, then replaced it with a
static string. This change allows more complex substitutions, where the
output depends on the input.

### Example use case
Say we want to keep only the first artist of a multi-artist credit, as
in the following list:
```
Neil Young & Crazy Horse -> Neil Young
Michael Hurley, The Holy Modal Rounders, Jeffrey Frederick & The Clamtones -> Michael Hurley
James Yorkston and the Athletes -> James Yorkston
````
This would previously have required three separate rules, one for each
resulting artist. By using a regex substitution, we can get the desired
behaviour in a single rule:
```yaml
substitute:
  ^(.*?)(,| &| and).*: \1
```
(Capture the text until the first `,` ` &` or ` and`, then use that
capture group as the output)

### Notes
I've kept the previous behaviour of only applying the first matching
rule, but I'm not 100% sure it's the ideal approach.
I can imagine both cases where you want to apply several rules in
sequence and cases where you want to stop after the first match.
2024-11-22 05:02:50 +00:00
..
_static Transparent background logo for docs 2023-10-29 10:30:33 +01:00
dev Remove support for Python 3.7 in the build and docs 2024-06-05 04:41:02 +01:00
guides small grammar corrections 2024-06-10 20:18:58 -03:00
plugins Revert configuration format changes 2024-10-14 22:54:38 +02:00
reference [doc/reference/config] Re-write explanation for 'overwrite_null' 2024-09-12 14:26:50 +02:00
changelog.rst Perform a regex substitution in the substitute plugin (#5357) 2024-11-22 05:02:50 +00:00
code_of_conduct.rst Integrate code of conduct 2023-10-27 21:55:13 +10:00
conf.py Increment version to 2.1.0 2024-11-22 01:50:28 +00:00
contributing.rst add CONTRIBUTING.rst to the docs 2020-07-20 19:56:05 -07:00
faq.rst Update all docs with Poetry 2024-06-10 13:10:16 +01:00
index.rst Integrate code of conduct 2023-10-27 21:55:13 +10:00
Makefile Add new livereload server for docs 2016-01-25 13:19:26 -08:00
modd.conf Switch to modd for live docs build 2017-12-21 11:39:08 -05:00
team.rst [docs/team] Add '@bal-e' 2024-07-31 23:24:18 +02:00