I am trying to create a hierarchical document using StringTemplate.
For example, a list of dire开发者_JAVA技巧ctories:
\alpha
\file1
\file2
\beta
\file3
\gamma
\file4
\file5
\file6
Is this even possible with StringTemplate?
Simple example would be:
list.st
$it.title$
$it.children:list()$
page.st
$rootNode.children:list()$
For more information, you can read An introduction to StringTemplate (as well as Collections and Template Groups and Complex Data Types and Renderers in this trilogy). And don't forget official StringTemplate documentation.
精彩评论