ev3dev / ev3dev-lang

(deprecated) language bindings for ev3dev sensors, motors, LEDs, etc.
GNU General Public License v2.0
56 stars 39 forks source link

autogen camel_case filter does not capitalize the first letter #107

Closed rhempel closed 8 years ago

rhempel commented 8 years ago

In writing the pure-python bindings, I noticed that the camel-case filter does not capitalize the first letter - I worked around it like this:

{% assign class_name = currentClass.friendlyName | camel_case | capitalize %}
WasabiFan commented 8 years ago

As I understand it, camelCase has a lower first letter (like a camel with its head down); I think you're thinking of PascalCase. I'm not sure if I have implemented a PascalCase filter, but the extra capitalize call should fix it (I can implement Pascal if you'd like).

dlech commented 8 years ago

By definition, the first letter of camelCase is not capitalized. You want PascalCase.

https://en.wikipedia.org/wiki/CamelCase

dlech commented 8 years ago

Beat me by three seconds :wink:

rhempel commented 8 years ago

If you want to put in a PascalCase filter you can, the workaround works for me.