[stringtemplate-interest] padding and such for pretty printing
Zenaan Harkness
zen at freedbms.net
Sat Jul 5 20:01:38 PDT 2008
> <if(width(anotherTemplate()) > 20)>...<else>...<endif>
>
> This means we have to add expressions within IF tags and I would need
> to do some type checking to make sure that you only did computations
> on things like width() function results.
>
> Has anybody built a pretty printer and know what the requirements
I've only done mine at the model layer, so it is somewhat specific to my
model.
I'm introducing new model types, so it is getting more generic.
I have formatting of the following genres:
- truncation (to show short version of longer strings)
- the obvious toUpper/Lower
- padding formatting, which is high-performance if a standard
pad character is used (which I think is all I support for now).
I don't have a "requirements spec", and I wrote the code earlier this
year now, but happy to pass on the code to anyone interested.
Also, I wrote a clean STGTraverser, for Iterating, and Iterable-ing,
StringTemplateGroup parents. Again, just email if you want it.
zen
--
Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.
More information about the stringtemplate-interest
mailing list