[stringtemplate-interest] <@region> in .st files

Terence Parr parrt at cs.usfca.edu
Mon Jan 12 11:19:20 PST 2009


On Jan 9, 2009, at 7:40 AM, Roman Odaisky wrote:

> Greetings,
>
> Is it possible to use regions in .st template files (as opposed  
> to .stg group
> files)?

Nope..sorry.

> The actual problem I want to solve is adding <link>/<style>/<script>/ 
> etc tags
> to the <head> section of an HTML document. I have a main.st template  
> that
> looks like this:
>
> <html>
> <head>
>    ...
> </head>
> <body>
>    ...
>    $({pages/$page$})(...)$
> </body>
> </html>
>
> and I want pages/something.st templates to be able to add something  
> to the
> areas outside their jurisdiction. What is the correct way to  
> implement this?

I think template group inheritance is the right answer here. Just  
invoke $foo()$ and define foo.st in the subgroup.

Ter


More information about the stringtemplate-interest mailing list