Text::Template is a Perl library that allows to generate text from text containing Perl code that is evaluated.
Questions tagged [texttemplate]
43 questions
2
votes
2 answers
Mono.TextTemplating passing parameters to template
I try to pass a parameter(foo) to an existing template(MyTemplate.tt) with this command:
TextTransform.exe -a=foo!bar -o Output.txt MyTemplate.tt
MyTemplate.tt:
<#@ template language="C#" #>
<#@ import namespace="System.IO" #>
<#
…

user1579585
- 55
- 1
- 6
1
vote
0 answers
How to Create/Modify an Interface given the Method definitions of a Class
We are moving from classic ASP to ASP.NET. Our current website uses hundreds of stored procedures and we are looking at gradually converting these to LINQ. We are also using POCO Entities using the Text Template provided by Microsoft to aid in the…

Anthony Wood
- 395
- 1
- 3
- 16
1
vote
3 answers
Can T4 templates use the same library
I have a library that defines a class
namespace ClassLibrary1
{
public class Class1
{
public static readonly int Rate = 5;
}
}
In the same lib I add a tt file
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@…

R.D
- 4,781
- 11
- 41
- 58
1
vote
1 answer
Generating code based on .json and .gotmpl file
I am asking this simple question as, after researching for quite some time, I still haven't found an answer yet.
I am trying to use this repository https://github.com/StefanAbl/go-freeipa, and updating the generated code with the latest freeipa…

Anghille
- 83
- 1
- 6
1
vote
0 answers
How to pass static variable to golang text/template function
I want to pass the static string "user_should_share_the_information" to this function, but the text/template tell me that the function "user_should_share_the_information" not found
But I just only want to treat "user_should_share_the_information" as…

lanyyyy
- 11
- 1
1
vote
2 answers
"for" loop inside a Text::Template template
I'm trying to use perl Text::Template for short templates and so far failed to get it to iterate over an array.
Here is a short test program I wrote to demonstrate what I'm trying to do:
#!/usr/bin/perl
use Text::Template;
my $template =…

Capt. Crunch
- 4,490
- 6
- 32
- 38
1
vote
1 answer
How to ask for the outer class in IntelliJ's templating language?
I found out how to change the default templates in IntelliJ when generating toString and hashCode/equals implementations but I cannot find any proper documentation on what variables are accessible. Autocomplete helps but it does not show me any such…

Rafael Winterhalter
- 42,759
- 13
- 108
- 192
1
vote
0 answers
How to change default tag delimiters in mustache sharp
I use mustache sharp and according to the mustache 5 documentation we can change the default tag delimiters.
* {{default_tags}}
{{=<% %>=}}
* <% erb_style_tags %>
<%={{ }}=%>
* {{ default_tags_again }}
should we change the default tag in html…

ali
- 1,023
- 2
- 14
- 38
1
vote
1 answer
Output '{{$NEXT}}' with Text::Template
The NextRelease plugin for Dist::Zilla looks for {{$NEXT}} in the Changes file to put the release datetime information. However, I can't get this to be generated using my profile.ini. Here's what I have:
[GenerateFile / Generate-Changes ]
filename …

Nate Glenn
- 6,455
- 8
- 52
- 95
1
vote
0 answers
EF 4.1 to EF 5.0 Migration (entity.tt files)
I have a project EF in 4.1 that I want to migrate to 5.0. Originally the entity code generation templates included some Association Fixup functions including FixupFrame and FixupCluster. Are these still neccessary in 5.0?
What else should I look out…

Raheel Khan
- 14,205
- 13
- 80
- 168
1
vote
2 answers
Installing Subsonic - adding Text Templates does nothing
I'm trying to start using Subsonic (v3). The brief installation instructions indicate that I must:
add a reference to the DLL = Done
edit Setting.ttinclude to use right connection string = Done; added appsettings to web.config
add templates to…

CJM
- 11,908
- 20
- 77
- 115
0
votes
0 answers
A namespace cannot directly contain members such as fields or methods and 'ReportTemplate' is not defined in T4 Run-time Text Templates vb.net
I'd use T4 Run-time Text Templates so I can pass data to the html template and render the report simply.
But I have an error is there something wrong with my code .
Thanks
Public Class Form1
Private Sub Form1_Load(sender As Object, e As…

roy
- 693
- 2
- 11
0
votes
2 answers
Can not use DisplayAttribute in T4 template
In my custom T4 template I have to read DisplayAttribute of a type. But I'm keep getting different errors after struggling with several solutions.
Here is part of my .tt file :
<#@ template debug="true" hostspecific="true" language="C#"…

theGhostN
- 342
- 7
- 20
0
votes
1 answer
Go text/template Form handling, with custom FuncMap - function returning blank string outputs garbage
Using Go html/template functionality, with custom FuncMap. The custom function I've defined "isChecked(checkName string, form url.Values)" returns the string "checked" if the checkbox with checkName exists in the form, and a blank string if it does…

crizzo
- 3
- 4
0
votes
0 answers
How can I access the name of the T4 output file via code?
Visual Studio's T4 templates offer the Output Directive which allows me to specify the file extension of the generated file as follows:
<#@ output extension=".cs" #>
I would like to access that file extension from the code within the T4 template so…

ackh
- 1,648
- 2
- 18
- 36