Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

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

Open
glynnis opened this issue Oct 16, 2018 · 3 comments
Assignees

Comments

@glynnis
Copy link

glynnis commented Oct 16, 2018

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).

@rodi01
Copy link
Owner

rodi01 commented Oct 16, 2018

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 rodi01 self-assigned this Oct 16, 2018
@glynnis
Copy link
Author

glynnis commented Oct 16, 2018

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
Copy link
Author

glynnis commented Oct 16, 2018

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].

rodi01 added a commit that referenced this issue Nov 22, 2018
Param case will work for point 1 and 2 on #99
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants