#1 2010-10-11 10:50

JeremyNicoll
Member
From: Edinburgh, Scotland
Registered: 2010-10-08
Posts: 9

Allow block comments to be placed in Presets

Presets with many steps, or those with regexes in them can be hard to understand, especially some weeks after you first wrote them. I'd like to see an easy way to embed comments in them.  I already do so - in an ugly way - by defining rules like:

15  Replace first "!-!-!" with ""
16  Replace first "!-!-!" with "The following regex splits the filename into three sections, intended to be:              "
17  Replace first "!-!-!" with ""
18  Replace first "!-!-!" with "  everything up to the first underscore                   eg:   'Abcdef 23 sample_'          "
19  Replace first "!-!-!" with "  the next 4-5 digits                                             eg:   '00555'                           "
20  Replace first "!-!-!" with "  everything else                                                  eg:   ' blah blah blah'                "
21  Replace first "!-!-!" with ""

working on the assumption that the 'find' literal won't generally be present in any filename.  But it would be easier - and look far better - if the app supported a rule 'type' of comment, which might look something like this on display:

15  Comment
16  Comment  The following regex splits the filename into three sections, intended to be:
17  Comment
18  Comment    everything up to the first underscore                   eg:   'Abcdef 23 sample_'
19  Comment    the next 4-5 digits                                             eg:   '00555'           
20  Comment    everything else                                                  eg:   ' blah blah blah'
21  Comment     

I'd assume that this would translate directly into Preset file lines like:

[Rule20]
Name=comment
Config= ++everything else++++++++++++++++++++++++++++++++++++++++eg:+++'+blah+blah+blah'

[Rule21]
Name=comment
Config= +

It would be nicer though, from a user point of view, if a block of comments could be defined as a single entity (so for example one could write a long description in an editor then c&p the block of lines into ReNamer).  That might be stored as:

[Rule88]
Name=comment
Config=one+line\n+and+another+line\nhere+is+a+third+line\nand+so+on

Offline

#2 2018-06-24 23:54

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: Allow block comments to be placed in Presets

Rule comments have been implemented in ReNamer 6.8.0.4 Beta.

- You can add/edit rule comments via the rules context menu, or using a Shift+Enter hotkey.
- Comments are displayed in the Statement column, replacing the auto-generated rule description, when available.

Offline

Board footer

Powered by FluxBB