Closed leonardopsantos closed 11 months ago
Some Mustache implementations support filters, which would enable you to do such a thing within the template. I don't know whether this is also the case for pystache. Failing filters, you can preprocess the data so they are already formatted when interpolation happens.
Filters have not been standardized yet, you can find previous discussion about them via https://github.com/mustache/spec/discussions/153.
Closing this, as this repository is only about the Mustache website, not about the template language.
I'm writing a template that eventually will render C structures. For that, I want to set the minimum substitution length, pretty much like printf("%10s") would do, so I get aligned members in my header file.
Is there a way to set the minimum length of a string when it's substituted or I have to do it on my context?
I would like to render it like:
I know I could pass the resulting header file in a beautifier tool like indent or uncrustify, but I'm curious if it can be done in Mustache.
Thanks!!