devbridge / Styleguide

MIT License
1.44k stars 87 forks source link

Remove uppercase letters and spaces from filenames of categories #169

Closed andrius1 closed 8 years ago

andrius1 commented 8 years ago

For example, when I create category and name it "App Messages", styleguide saves database file as "App Messages.txt". Uppercase letters or spaces can cause problems with URL paths on some environments or git.

I think file name should be converted to something like "app_messages.txt".

VaclovasV commented 8 years ago

and from app_messages, how we will know, it is App Messages, App messages or app messages? And what exact problems can be caused in git or other environments? Because from how coded is api, I can see none.

andrius1 commented 8 years ago

Name of category should be stored as a string inside the .txt file, for example:

[ { "categoryName": "App Messages", }, .... there goes snippets ]

VaclovasV commented 8 years ago

but naming is still a "first in a queue" file and naming is related with category name, so this is just a duplication :) Do you have existing issues with current implementation?

andrius1 commented 8 years ago

Yep, we had problems when doing git merge. One person changed the snippets, other person changed the name of category (App messages -> App Messages), and git created two separate files.

Also, we have a problem, that somehow we have file "Layout elements.txt" and on the categories list it is stored as "Layout Elements". And that works perfectly on localhost, but it doesn't work when you run styleguide on other environment.

VaclovasV commented 8 years ago

First behavior is quite normal and this solution would not resolve issue. About second - lets investigate, how these incorrect entries appeared and maybe this is already fixed. @miezis - maybe you are familiar with this or maybe it is already fixed?

miezis commented 8 years ago

This was not altered a long time. Maybe @andrius1 remembers how did he produce that?

ghost commented 8 years ago

I guess is a matter of file naming good practices. I would vote for no spaces and lower case scenario. In regards of @VaclovasV example, all three names "App Messages", "App messages", "app messages" should be treated as duplicates.

VaclovasV commented 8 years ago

Closing this, reopen if needed.