开发者

Hierarchical data in StringTemplate

开发者 https://www.devze.com 2023-01-13 18:57 出处:网络
I am trying to create a hierarchical document using StringTemplate. For example, a list of dire开发者_JAVA技巧ctories:

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

精彩评论

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

关注公众号