views:

27

answers:

1

I am trying to create a hierarchical document using StringTemplate.

For example, an list of directories :

\alpha

   \file1
   \file2

\beta

   \file3

\gamma

   \file4
   \file5
   \file6

Is this even possible with StringTemplate?

A: 

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.

Jonas