Preserve line breaks for example cases in substitution plugin docs (#5846)

## Description

Adds line block markup to example substitutions in the plugin
documentation, so that each case is shown on a separate line:

> The replacement can be an expression utilising the matched regex,
allowing us to create more general rules. Say for example, we want to
sort all albums by multiple artists into the directory of the first
artist. We can thus capture everything before the first ,, `` &`` or ``
and``, and use this capture group in the output, discarding the rest of
the string.
> 
> ```yaml
> substitute:
>  ^(.*?)(,| &| and).*: \1
> ```
>
> This would handle all the below cases in a single rule:
>
>> Bob Dylan and The Band -> Bob Dylan
>> Neil Young & Crazy Horse -> Neil Young
>> James Yorkston, Nina Persson & The Second Hand Orchestra -> James
Yorkston
This commit is contained in:
Noor 2025-07-02 20:40:37 +02:00 committed by GitHub
parent dd6cb538ac
commit ac96b9b64e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -61,6 +61,8 @@ Other changes:
* Documentation structure for auto generated API references changed slightly.
Autogenerated API references are now located in the `docs/api` subdirectory.
* :doc:`/plugins/substitute`: Fix rST formatting for example cases so that each
case is shown on separate lines.
2.3.1 (May 14, 2025)
--------------------

View file

@ -31,9 +31,9 @@ group in the output, discarding the rest of the string.
This would handle all the below cases in a single rule:
Bob Dylan and The Band -> Bob Dylan
Neil Young & Crazy Horse -> Neil Young
James Yorkston, Nina Persson & The Second Hand Orchestra -> James Yorkston
| Bob Dylan and The Band -> Bob Dylan
| Neil Young & Crazy Horse -> Neil Young
| James Yorkston, Nina Persson & The Second Hand Orchestra -> James Yorkston
To apply the substitution, you have to call the function ``%substitute{}`` in the paths section. For example: