Thursday, 15 April 2010

stringtemplate 4 - Is it possible to combine group files and group directories? -


I am using StringTemplate to create HTML and I use STGroupFile and STGroupDir This way I have a directory of group files. In this way I can include multiple templates in a file, but I can add templates from many files. It does not appear that there is support for it, but I thought that if I see something then I will see it.

If you are wondering why I would like to do this, see an example from the StringTemplate Docs:

  test (name) :: = "$ name: bracket () $ "// Apply bracket template in each name bracket (x): =" [$ x $] "// parameter parameter with square bracket   

All the above one file (Test.st) and we are using STGroupDir , it will be unable to resolve the "bracket (x)" template unless it is a separate file (bracket.st) Not in In this particular example, the bracket is like a local assistant that is useful for cleaning the main template. In this case, you probably do not want to show the bracket outside of the test.

However, if you want to create a library of simple supportive templates, you can find them all in one file and each of them is accessible to templates in other files.

"post-text" itemprop = "text">

Disclaimer: I am using StringTemplate in C # Em>

You have to use .stg files with a group of templates. StringTemplate groups can import groups of other templates or templates, and you can create those groups from a file or directory.

No comments:

Post a Comment