Skip to content

Commit

Permalink
Merge pull request #199 from sempare/dev
Browse files Browse the repository at this point in the history
v1.8.0
  • Loading branch information
darnocian authored Sep 23, 2024
2 parents 2bbdf4c + 85a36f1 commit 01b9c1b
Show file tree
Hide file tree
Showing 73 changed files with 2,018 additions and 2,000 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [darnocian]
8 changes: 4 additions & 4 deletions .github/workflows/delphi-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: Sempare.Template.Tester.exe -cm:quiet -exit:continue -b -xmlfile:.\results.xml

- name: publish win32 debug test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Win32 Debug Results
path: './Win32/Debug/results.xml'
Expand All @@ -53,7 +53,7 @@ jobs:
run: Sempare.Template.Tester.exe -cm:quiet -exit:continue -b -xmlfile:.\results.xml

- name: publish win32 release test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Win32 Release Results
path: './Win32/Release/results.xml'
Expand All @@ -75,7 +75,7 @@ jobs:
run: Sempare.Template.Tester.exe -cm:quiet -exit:continue -b -xmlfile:.\results.xml

- name: publish win64 debug test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Win64 Debug Results
path: './Win64/Debug/results.xml'
Expand All @@ -97,7 +97,7 @@ jobs:
run: Sempare.Template.Tester.exe -cm:quiet -exit:continue -b -xmlfile:.\results.xml

- name: publish win64 release test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Win64 Release Results
path: './Win64/Release/results.xml'
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "thirdparty/DUnitX"]
path = thirdparty/DUnitX
url = git@github.com:VSoftTechnologies/DUnitX.git
876 changes: 202 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

92 changes: 45 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,27 @@
![delphi compatibility](https://img.shields.io/badge/delphi%20compatability-XE%204%20or%20newer-brightgreen)
![platform compatibility](https://img.shields.io/badge/platform-Android32%20%7C%20Android64%20%7C%20Linux64%20%7C%20macOS64%20%7C%20Win32%20%7C%20Win64-lightgrey)
![license](https://img.shields.io/github/license/sempare/sempare-delphi-template-engine)

# ![](./images/sempare-logo-45px.png) Sempare Template Engine

Copyright (c) 2019-2024 [Sempare Limited](http://www.sempare.ltd)

Contact: <info@sempare.ltd>

License: [GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) or [Sempare Limited Commercial License](./docs/commercial.license.md)
License: [Apache v2.0](https://www.apache.org/licenses/LICENSE-2.0) or [Sempare Limited Commercial License](./docs/commercial.license.md)

Open Source: https://github.com/sempare/sempare-delphi-template-engine

## Contents
- [Introduction](#Introduction)
- [Call To Action](#CallToAction)
- [Quickstart](#Quickstart)
- [Features](#Features)
- [Objectives](#Objectives)
- [Requirements](#Requirements)
- [Installation](#Installation)
- [GetIt](#GetIt)
- [Boss](#Boss)
- [Delphinus](#DelphinusSupport)
- [Manual Install](#ManualInstall)
- [Feedback](#Feedback)
- Template Language
- [Statements](./docs/statements.md)
- [Expressions](./docs/expressions.md)
- [Builtin functions](./docs/builtin-functions.md)
- [Builtin variables](./docs/builtin-variables.md)
- [Comments](./docs/comments.md)
- [Template Registry](./docs/template-registry.md)
- Customisation
- [Custom functions](./docs/custom-functions.md)
- [Configuration](./docs/configuration.md)
- [Components](./docs/components.md)
- [Tricks](./docs/tricks.md)
- [Template Patterns](./docs/template-patterns.md)
- [Whitespace Removal](./docs/whitespace-removal.md)
- [Internals](./docs/internals.md)
- [Restrictions/Limitations/Known Bugs](./docs/restrictions.md)
- [License](#License)
*Questionaire*: https://docs.google.com/forms/d/e/1FAIpQLScioIiDxvsWK01fMFqYr9aJ6KhCGeiw4UaU_esGuztEE7vYwA/viewform

<a name="Introduction"><h2>Introduction</h3></a>

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:
- web sites using template engines (for server side scripting)
- code generation
- mail merge
- mail merge
- notification messages

Please review the [License](#License) section below before including the Sempare Template Engine in commercial products.

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.
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.

Example usage:
```
Expand All @@ -68,20 +36,20 @@ type
end;
begin
var tpl := Template.Parse(
'My name is <% name %>.'#13#10 +
'My favourite sport is <% favourite_sport %>.'#13#10 +
'My name is <% name %>.'#13#10 +
'My favourite sport is <% favourite_sport %>.'#13#10 +
'Counting... <% for i := 1 to count %><% i %><% betweenitems %>, <% end %>' +
'Counting... <% for i := 1 to count ; print(i) ; betweenitems ; print(', '); onbegin; print('[ '); onend; print('] '); end %>'
);
var info : TInformation;
info.name := 'conrad';
info.favourite_sport := 'ultimate';
info.count := 3;
writeln(Template.Eval(tpl, info));
writeln(Template.Eval(tpl, info));
end.
```

The project uses Run-time Type Information (RTTI) to allow for almost any type to be dereferenced within the template script.
The project allows for almost any type to be dereferenced within the template script.

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.

Expand All @@ -93,6 +61,38 @@ Please 'star' the project on github.

![](./images/sempare-template-engine-start-cta.png)


## Contents
- [Introduction](#Introduction)
- [Call To Action](#CallToAction)
- [Quickstart](#Quickstart)
- [Features](#Features)
- [Objectives](#Objectives)
- [Requirements](#Requirements)
- [Installation](#Installation)
- [GetIt](#GetIt)
- [Boss](#Boss)
- [Delphinus](#DelphinusSupport)
- [Manual Install](#ManualInstall)
- [Feedback](#Feedback)
- Template Language
- [Statements](./docs/statements.md)
- [Expressions](./docs/expressions.md)
- [Builtin functions](./docs/builtin-functions.md)
- [Builtin variables](./docs/builtin-variables.md)
- [Comments](./docs/comments.md)
- [Template Registry](./docs/template-registry.md)
- Customisation
- [Custom functions](./docs/custom-functions.md)
- [Configuration](./docs/configuration.md)
- [Components](./docs/components.md)
- [Tricks](./docs/tricks.md)
- [Template Patterns](./docs/template-patterns.md)
- [Whitespace Removal](./docs/whitespace-removal.md)
- [Internals](./docs/internals.md)
- [Restrictions/Limitations/Known Bugs](./docs/restrictions.md)
- [License](#License)

<a name="Quickstart"><h2>Quickstart</h3></a>

There are a few ways to get started quickly.
Expand All @@ -117,7 +117,7 @@ There are a few ways to get started quickly.
- simple expression evaluation (logical, numerical and string)
- variable definition
- functions and methods calls
- dereference records, custom managed records, classes, arrays, JSON objects, TDataSet descendants and dynamic arrays
- dereference records, custom managed records, classes, interfaces, arrays, JSON objects, TDataSet descendants and dynamic arrays
- ternary operator
- safety
- max run-time protection
Expand Down Expand Up @@ -158,7 +158,6 @@ There should be no platform specific restrictions.
Have a look at Sempare.Template.Compiler.inc. The following defines can be defined if appropriate:

- SEMPARE_TEMPLATE_NO_INDY - if Indy is not present. This is used to access an html encoder if TNetEncoding is not available.
- SEMPARE_TEMPLATE_CONFIRM_LICENSE - if present, you confirm you understand the conditions.

<a name="Installation"><h2>Installation</h3></a>

Expand Down Expand Up @@ -220,16 +219,15 @@ The deployment process is based off the dev branch. Once we decide to push a new

<a name="License"><h2>License</h3></a>

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
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
no cost to you, or you may license it for use under the [Sempare Limited Commercial License](./docs/commercial.license.md)

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.
The dual-licensing scheme allows you to use and test the library under the appropriate license.

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
Sempare Template Engine or to any other party. A commercial license lasts into perpetuity, and entitles you to all future updates.
Sempare Template Engine or to any other party. A commercial license helps to ensure the project is maintained with continuous integration, patches, etc.

A commercial licence is provided per developer developing applications that uses the Sempare Template Engine. The initial license fee is $70 per developer.
For support thereafter, at your discretion, a support fee of $30 per developer per year would be appreciated.
A support fee of $70 per developer is appreciated.

The following payment links allow you to quickly subscribe. Please note that the initial license and support links are seperate.
- [Initial License Fee](https://buy.stripe.com/aEU7t61N88pffQIdQQ)
Expand Down
4 changes: 2 additions & 2 deletions Sempare.Template.Pkg.dpk
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
* *
* Contact: info@sempare.ltd *
* *
* Licensed under the GPL Version 3.0 or the Sempare Commercial License *
* Licensed under the Apache Version 2.0 or the Sempare Commercial License *
* You may not use this file except in compliance with one of these Licenses. *
* You may obtain a copy of the Licenses at *
* *
* https://www.gnu.org/licenses/gpl-3.0.en.html *
* https://www.apache.org/licenses/LICENSE-2.0 *
* https://github.com/sempare/sempare-delphi-template-engine/blob/master/docs/commercial.license.md *
* *
* Unless required by applicable law or agreed to in writing, software *
Expand Down
4 changes: 2 additions & 2 deletions Sempare.Template.Tester.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
* *
* Contact: info@sempare.ltd *
* *
* Licensed under the GPL Version 3.0 or the Sempare Commercial License *
* Licensed under the Apache Version 2.0 or the Sempare Commercial License *
* You may not use this file except in compliance with one of these Licenses. *
* You may obtain a copy of the Licenses at *
* *
* https://www.gnu.org/licenses/gpl-3.0.en.html *
* https://www.apache.org/licenses/LICENSE-2.0 *
* https://github.com/sempare/sempare-delphi-template-engine/blob/master/docs/commercial.license.md *
* *
* Unless required by applicable law or agreed to in writing, software *
Expand Down
4 changes: 2 additions & 2 deletions Sempare.Template.Tester.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
<DCC_UnitSearchPath>$(DUnitX);src;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<DCC_UnitSearchPath>thirdparty\DUnitX\Source;$(DUnitX);src;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<SanitizedProjectName>Sempare_Template_Tester</SanitizedProjectName>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;vclFireDAC;tethering;FireDACADSDriver;vcltouch;vcldb;bindcompfmx;inetdb;fmx;FireDACIBDriver;fmxdae;vquery260;dacvcl260;dbexpress;vclx;dsnap;FireDACCommon;RESTBackendComponents;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACMySQLDriver;FireDACCommonDriver;inet;bindcompdbx;vcl;ADODataProvider;dsnapcon;FireDACDataProvider;FireDACMSAccDriver;vclimg;FireDAC;DBXDataProvider;FireDACSqliteDriver;FireDACPgDriver;crcontrols260;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;fmxobj;vclwinx;dac260;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;DOSCommandDR;bindcomp;appanalytics;bindcompvcl;dbxcds;adortl;dsnapxml;dbrtl;inetdbxpress;fmxase;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_UsePackage>$(DCC_UsePackage)</DCC_UsePackage>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.5.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=ltd.sempare.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.5.0.0;Comments=</VerInfo_Keys>
Expand Down
2 changes: 1 addition & 1 deletion Sempare.TemplateEngine.dspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"metadata": {
"id": "Sempare.TemplateEngine",
"version": "1.7.7",
"version": "1.8.0",
"description": "Sempare Template Engine for Delphi allows for flexible text manipulation. It can be used for generating email, html, source code, xml, configuration, etc.\r\n\r\nCommercial non-gpl license available.",
"icon": "images\\sempare-logo-45px.png",
"authors": "Sempare Limited",
Expand Down
2 changes: 1 addition & 1 deletion boss.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Sempare Template Engine",
"description": "Sempare Template Engine for Delphi allows for flexible text manipulation. It can be used for generating email, html, source code, xml, configuration, etc.",
"version": "1.7.7",
"version": "1.8.0",
"homepage": "https://github.com/sempare/sempare-delphi-template-engine",
"mainsrc": "./src/",
"projects": [],
Expand Down
2 changes: 1 addition & 1 deletion demo/SempareTemplatePlayground/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ![](../../images/sempare-logo-45px.png) Sempare Template Engine

Copyright (c) 2019-2023 [Sempare Limited](http://www.sempare.ltd)
Copyright (c) 2019-2024 [Sempare Limited](http://www.sempare.ltd)

# Sempare Template Engine Playpen Demo

Expand Down
Loading

0 comments on commit 01b9c1b

Please sign in to comment.