You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Template engines are used often in technology where text needs to be customised by substituting variables with values from a data source. Examples where this may take place:
50
19
- web sites using template engines (for server side scripting)
51
20
- code generation
52
-
- mail merge
21
+
- mail merge
53
22
- notification messages
54
23
55
-
Please review the [License](#License) section below before including the Sempare Template Engine in commercial products.
56
-
57
-
The Sempare Template Engine is a small templating engine for [Delphi](https://www.embarcadero.com/products/delphi) (Object Pascal) that allows for templates to be created easily and efficiently by providing a simple and easy to use API.
24
+
The Sempare Template Engine is a small templating (scripting) engine for [Delphi](https://www.embarcadero.com/products/delphi) (Object Pascal) that allows for templates to be created easily and efficiently by providing a simple and easy to use API.
58
25
59
26
Example usage:
60
27
```
@@ -69,20 +36,20 @@ type
69
36
end;
70
37
begin
71
38
var tpl := Template.Parse(
72
-
'My name is <% name %>.'#13#10 +
73
-
'My favourite sport is <% favourite_sport %>.'#13#10 +
39
+
'My name is <% name %>.'#13#10 +
40
+
'My favourite sport is <% favourite_sport %>.'#13#10 +
74
41
'Counting... <% for i := 1 to count %><% i %><% betweenitems %>, <% end %>' +
75
42
'Counting... <% for i := 1 to count ; print(i) ; betweenitems ; print(', '); onbegin; print('[ '); onend; print('] '); end %>'
76
43
);
77
44
var info : TInformation;
78
45
info.name := 'conrad';
79
46
info.favourite_sport := 'ultimate';
80
47
info.count := 3;
81
-
writeln(Template.Eval(tpl, info));
48
+
writeln(Template.Eval(tpl, info));
82
49
end.
83
50
```
84
51
85
-
The project uses Run-time Type Information (RTTI) to allow for almost any type to be dereferenced within the template script.
52
+
The project allows for almost any type to be dereferenced within the template script.
86
53
87
54
In the example above, you can see that the '<%' start and '%>' end the scripting statement respectively. Within a scripting statement, you can reference variables, assign variables, use conditions, for and while loops, and include other templates.
88
55
@@ -94,6 +61,38 @@ Please 'star' the project on github.
@@ -159,7 +158,6 @@ There should be no platform specific restrictions.
159
158
Have a look at Sempare.Template.Compiler.inc. The following defines can be defined if appropriate:
160
159
161
160
- SEMPARE_TEMPLATE_NO_INDY - if Indy is not present. This is used to access an html encoder if TNetEncoding is not available.
162
-
- SEMPARE_TEMPLATE_CONFIRM_LICENSE - if present, you confirm you understand the conditions.
163
161
164
162
<aname="Installation"><h2>Installation</h3></a>
165
163
@@ -221,16 +219,15 @@ The deployment process is based off the dev branch. Once we decide to push a new
221
219
222
220
<aname="License"><h2>License</h3></a>
223
221
224
-
The Sempare Template Engine is dual-licensed. You may choose to use it under the restrictions of the [GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) at
222
+
The Sempare Template Engine is dual-licensed. You may choose to use it under the restrictions of the [Apache v2.0](https://www.apache.org/licenses/LICENSE-2.0) at
225
223
no cost to you, or you may license it for use under the [Sempare Limited Commercial License](./docs/commercial.license.md)
226
224
227
-
The dual-licensing scheme allows you to use and test the library with no restrictions, but subject to the terms of the GPL. A nominal fee is requested to support the maintenance of the library if the product is to be used in commercial products. This support fee binds you to the commercial license, removing any of the GPL restrictions, and allowing you to use the library in your products as you will. The Sempare Template Engine may NOT be included or distributed as part of another commercial library or framework without approval / commercial review.
225
+
The dual-licensing scheme allows you to use and test the library under the appropriate license.
228
226
229
227
A commercial licence grants you the right to use Sempare Template Engine in your own applications, royalty free, and without any requirement to disclose your source code nor any modifications to
230
-
Sempare Template Engine or to any other party. A commercial license lasts into perpetuity, and entitles you to all future updates.
228
+
Sempare Template Engine or to any other party. A commercial license helps to ensure the project is maintained with continuous integration, patches, etc.
231
229
232
-
A commercial licence is provided per developer developing applications that uses the Sempare Template Engine. The initial license fee is $70 per developer.
233
-
For support thereafter, at your discretion, a support fee of $30 per developer per year would be appreciated.
230
+
A support license of $70 per developer is appreciated.
234
231
235
232
The following payment links allow you to quickly subscribe. Please note that the initial license and support links are seperate.
0 commit comments