Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kchr
Copy link

@kchr kchr commented Jun 28, 2025

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.

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

To Do

  • Documentation. (If you've added a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • Tests. (Very much encouraged but not strictly required.)

Adds line block markup to example substitutions so that each case is
shown on a separate line.
@semohr semohr enabled auto-merge (squash) July 1, 2025 08:38
@semohr
Copy link
Contributor

semohr commented Jul 1, 2025

Thanks for the fix!

I've just enabled auto-merge. If you update the branch, it should merge into master automatically. Let me know if you run into any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants