[stringtemplate-interest] Javadoc generation using ST ?
Zenaan Harkness
zen at freedbms.net
Fri Apr 18 16:19:53 PDT 2008
>>>>>>> Is it possible to have the proper indentation (with asterisks) be
>>>>>>> generated using st?
>>>>>> Absolutely! The wrap=" * " option will do this for you. You can even
>>>>> I will, when I can make it work.
>>>>>
>>>>> My ST usage model is:
>>>>> 1) All my templates are in group files (none generated in code).
>>>>> 2) When I generate my output, I use a StringTemplateWriter, to write
>>>>> the output into a file.
>>>>>
>>>>> Despite setting stWriter.setLineWidth(16), _and_ adding wrap option to
>>>>> my templates, I get no wrappin!
>>> I always forget this too. Try toString(width). toString() doesnt wrap.
>> I can't call toString, since I'm doing the writer thing - writing
>> directly out to a file using StringTemplateWriter (as mentioned at point
>> 2) above), so I'm limited to using st.write, no toString for me, unless
>> I'm missing something?
> ah. I'm not at office at moment. can you look to see what tostring(int)
> invokes with write? Perhaps I made a special writer that wraps.
Everything seems as though it should work. Yes, I'm missing this:
My apologies. From the ST3.1 docs:
"... StringTemplate should wrap lines in between expression elements.
StringTemplate never breaks literals, but it can break in between a
literal and an expression."
I have been sending in single strings, for my javadoc section, thinking
the string (single element from the template's perspective) would get
broken up for wrapping purposes. Clearly I didn't read the docs
properly on first glance.
Now I just have to jig my model to do the required wrapping and bundling
into lists of Strings. Which should be relatively easy.
Now tested and proof of concepted ...
Thanks heaps
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