RenameIt icon indicating copy to clipboard operation
RenameIt copied to clipboard

Feature request: Add converter for kebab case and remove special characters

Open glynnis opened this issue 5 years ago • 3 comments

I'm a designer working with developers who prefer file names of exported assets in kebab case, with any special characters removed.

For example, I would like a converter that changes a file name like Bath icon (yes)@2x.png to [email protected]. So it would:

  1. lowercase everything
  2. replace spaces with -
  3. strip any special characters like ()!@#$%^&*+= etc.

Perhaps kebab case (items #1-2) could be one converter, and stripping special characters could be another (#3).

glynnis avatar Oct 16 '18 14:10 glynnis

I can easily manipulate the text to lowercase and replace spaces with -. Removing special characters is doable but in your example, you have the @ symbol and that would be removed too (Bath icon (yes)@2x.png to bath-icon-yes2x.png)

I think the best way would be separating them like you suggested. The first case shouldn't take me too long to do it. The second one is a bit more complicated.

rodi01 avatar Oct 16 '18 15:10 rodi01

Ah, good point re: @.

I'd argue that the @ should actually be the one special character preserved since it's used for pixel density suffixes like @2x.

glynnis avatar Oct 16 '18 15:10 glynnis

Maybe a converter that removes the special characters you specify would be good?

Not sure what syntax works best for converters, but just for example, something like %*sp('%()')% would change a file name like asset(20%)@2x.png to [email protected].

glynnis avatar Oct 16 '18 15:10 glynnis