Hello there !
I’m really trying to make the most out of Tuist right now and while designing my template, I found that I really miss a specific filter which is lowercase_first that as you guess a filter that just lowercase the first letter to create a property name base out of the template name for example.
I saw in the Stencil project that it is possible to create custom filter but it doesn’t seems to be accessible from a Tuist user perspective.
Adding this seems to only consist of something like this:
import Stencil
let ext = Extension()
// Register your filters and tags with the extension
let environment = Environment(extensions: [ext])
ext.registerFilter("lowercase_first") { (value: Any?) in
guard let string = value as? String else { return value }
return string.prefix(1).lowercased() + string.dropFirst()
}
Here is the documentation about it: Custom Template Tags and Filters — Stencil 0.15.1 documentation
What do you think ? Maybe I need to suggest this directly to the Stencil project ?