开发者

Hierarchical data in StringTemplate

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜