-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from sempare/dev
v1.7.0 Release
- Loading branch information
Showing
81 changed files
with
11,510 additions
and
3,274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,35 +14,45 @@ License: [GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) or [Sempare Li | |
Open Source: https://github.com/sempare/sempare-delphi-template-engine | ||
|
||
## Contents | ||
1. [Introduction](#Introduction) | ||
2. [Quickstart](#Quickstart) | ||
3. [Features](#Features) | ||
4. [Objectives](#Objectives) | ||
5. [Requirements](#Requirements) | ||
6. [Installation: GetIt](#GetIt) | ||
7. [Installation: Delphinus](#DelphinusSupport) | ||
8. [Installation: Manual Install](#ManualInstall) | ||
9. [Feedback](#Feedback) | ||
10. [Statements](./docs/statements.md) | ||
11. [Expressions](./docs/expressions.md) | ||
12. [Builtin functions](./docs/builtin-functions.md) | ||
13. [Builtin variables](./docs/builtin-variables.md) | ||
14. [Custom functions](./docs/custom-functions.md) | ||
15. [Configuration](./docs/configuration.md) | ||
16. [Components](./docs/components.md) | ||
17. [Tricks](./docs/tricks.md) | ||
18. [Template Patterns](./docs/template-patterns.md) | ||
19. [Internals](./docs/internals.md) | ||
20. [Restrictions/Limitations/Known Bugs](./docs/restrictions.md) | ||
21. [License](#License) | ||
|
||
## Introduction | ||
- [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="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 | ||
- notification messages | ||
- 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. | ||
|
||
|
@@ -77,25 +87,28 @@ In the example above, you can see that the '<%' start and '%>' end the scripting | |
|
||
**NOTE** In examples in this documentation I may use the latest Delphi syntax, e.g. inline variable declarations. This is not backward compatible as they were introduced in Delphi 10.2 and are used to shorten the code/examples being illustrated in the documentation. The codebase will attempt to be as backward compatible as possible. | ||
|
||
## Call to action | ||
<a name="CallToAction"><h2>Call to action</h3></a> | ||
|
||
Please 'star' the project on github. | ||
|
||
![](./images/sempare-template-engine-start-cta.png) | ||
|
||
## Quickstart | ||
<a name="Quickstart"><h2>Quickstart</h3></a> | ||
|
||
[Try the demo](./demo/VelocityDemo/README.md) if you want to dive in quick and play with the template engine. | ||
There are a few ways to get started quickly. | ||
|
||
Quick tutorials on [You Tube](https://www.youtube.com/playlist?list=PLjjz4SuVScHreGKEInvrjPtLPMBU6l130). | ||
The playlist has a few videos that are very short (most less than a minute - blink and they are done). You can drag the slider in the videos if you miss something or refer to the rest of the documentation. | ||
- Look at the examples on how to do server side scripting using some popular web frameworks: | ||
- [WebBroker](https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Creating_WebBroker_Applications) [Demo](https://github.com/sempare/sempare-delphi-template-engine/tree/main/demo/WebBrokerStandalone) | ||
- [Horse](https://github.com/hashload/horse) [Demo](https://github.com/sempare/sempare-delphi-template-engine-horse-demo) | ||
|
||
[Try the demo](./demo//SempareTemplatePlaypen/README.md) if you want to dive in quick and play with the template engine. | ||
|
||
## Features | ||
<a name="Features"><h2>Features</h3></a> | ||
- statements | ||
- if, elif, else statements | ||
- for and while statements | ||
- include statement | ||
- extends / block statements | ||
- with statement | ||
- function/method calls | ||
- expressions | ||
|
@@ -115,13 +128,13 @@ The playlist has a few videos that are very short (most less than a minute - bli | |
- allow use of custom encoding (UTF-8 with BOM, UTF-8 without BOM, ASCII, etc) | ||
- extensibile RTTI interface to easily dereference classes and interfaces (current customisations for ITemplateVariables, TDictionary, TJsonObject) | ||
|
||
## Objectives | ||
<a name="Objectives"><h2>Objectives</h3></a> | ||
|
||
The Sempare Template Engine is not intended to be a fully featured general purpose programming language such as PHP where the script itself could be a self contained programming language (but it does have most of the features). | ||
|
||
Sempare Template Engine aims to provide just enough functionality to allow you to easily work with the 'view' aspects of a template. Any enhanced functionality required from the scripting environment should be provided by the custom functions written in Object Pascal. | ||
|
||
## Requirements | ||
<a name="Requirements"><h2>Requirements</h3></a> | ||
|
||
The template engine works with modern versions of [Delphi](https://www.embarcadero.com/products/delphi). | ||
|
||
|
@@ -144,19 +157,30 @@ Have a look at Sempare.Template.Compiler.inc. The following defines can be defin | |
- 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="GetIt"><h2>Installation: GetIt</h2></a> | ||
<a name="Installation"><h2>Installation</h3></a> | ||
|
||
<a name="GetIt"><h3>GetIt</h3></a> | ||
|
||
The Sempare Template Engine for Delphi can be installed via the [Embarcadero GetIt manager](https://getitnow.embarcadero.com/?q=sempare&product=rad-studio) | ||
|
||
This will add the *src* folder to the search path so you can start working immediately. | ||
|
||
<a name="DelphinusSupport"><h2>Installation: Delphinus Support</h2></a> | ||
<a name="Boss"><h3>Boss</h3></a> | ||
|
||
The Sempare Template Engine for Delphi can be installed via the [Boss](https://github.com/hashload/boss/releases) package manager. | ||
|
||
Simply run: | ||
``` | ||
boss install sempare/sempare-delphi-template-engine | ||
``` | ||
|
||
<a name="DelphinusSupport"><h3>Delphinus</h3></a> | ||
|
||
The Sempare Template Engine for Delphi can be installed via the [Delphinus](https://github.com/Memnarch/Delphinus) package manager. | ||
|
||
This will add the *src* folder to the search path so you can start working immediately. | ||
|
||
<a name="ManualInstall"><h2>Installation: Manual Install</h2></a> | ||
<a name="ManualInstall"><h3>Manual Install</h3></a> | ||
|
||
Start by adding the *src* folder to the Delphi search path. Otherwise, there are some projects you can use: | ||
|
||
|
@@ -168,36 +192,43 @@ Open __Sempare.Template.Engine.Group.groupproj__ which will include: | |
|
||
- __Sempare.Template.Tester.dproj__ | ||
|
||
100+ unit tests | ||
180+ unit tests | ||
|
||
- __demo\VelocityDemo\Sempare.Template.Demo.dproj__ | ||
- __demo\SempareTemplatePlayground\Sempare.TemplateEngine.Playground.dproj__ | ||
|
||
The velocity real-time demo. | ||
|
||
The Sempare Template Playground demo which provides a rich experience for testing the various template language features. | ||
|
||
## Feedback | ||
<a name="Feedback"><h2>Feedback</h3></a> | ||
|
||
You can raise issues on [GitHub](https://github.com/sempare/sempare.template) and they will be addressed based on priority. | ||
|
||
Most features have some basic tests in place. If a bug is been discovered, please include a basic test/scenario replicating the issue if possible as this will ease the investigation process. | ||
|
||
# Contributions | ||
<a name="Contributions"><h2>Contributions</h3></a> | ||
|
||
Review [contibution terms and conditions](./docs/CONTRIBUTION.pdf) to contribute to the project. | ||
|
||
# License | ||
<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 | ||
no cost to you, or you may purchase for user under the [Sempare Limited Commercial License](./docs/commercial.license.md) | ||
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 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 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. | ||
|
||
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 Templte Engine to any other party. A commercial licence lasts into perpetuity, and entitles you to all future updates - free of charge. | ||
Sempare Template Engine or to any other party. A commercial license lasts into perpetuity, and entitles you to all future updates. | ||
|
||
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. The initial site licensing fee is $1,500 and the annual site support licensing fee is $500. | ||
|
||
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) | ||
- [Annual Support License Fee](https://buy.stripe.com/00g8xa4ZkbBr480145) | ||
|
||
A commercial licence is provided per developer developing applications that use the Sempare Template Engine. The initial cost is $70 per developer and includes first year of support. | ||
For support thereafter, at your discretion, a support fee of $30 per developer per year would be appreciated (the cost of a few cups of coffee). Please contact us for site license pricing. | ||
The following payment links are available for site licenses. Please note that the initial license and support links are seperate. | ||
- [Initial Site License Fee](https://buy.stripe.com/eVa00E77s7lbfQIaEG) | ||
- [Annual Support License Fee](https://buy.stripe.com/6oE14I4Zk6h7fQI003) | ||
|
||
Please send an e-mail to [email protected] to request an invoice which will contain the bank details. | ||
Please send an e-mail to [email protected] to request an invoice which will contain alternative payment details. | ||
|
||
Support and enhancement requests submitted by users that pay for support will be prioritised. New developments may incur additional costs depending on time required for implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
(*%************************************************************************************************* | ||
(*%************************************************************************************************** | ||
* ___ * | ||
* / __| ___ _ __ _ __ __ _ _ _ ___ * | ||
* \__ \ / -_) | ' \ | '_ \ / _` | | '_| / -_) * | ||
* |___/ \___| |_|_|_| | .__/ \__,_| |_| \___| * | ||
* |_| * | ||
**************************************************************************************************** | ||
* * | ||
* Sempare Templating Engine * | ||
* Sempare Template Engine * | ||
* * | ||
* * | ||
* https://github.com/sempare/sempare-delphi-template-engine * | ||
**************************************************************************************************** | ||
* * | ||
* Copyright (c) 2019-2021 Sempare Limited * | ||
* Copyright (c) 2019-2023 Sempare Limited * | ||
* * | ||
* Contact: [email protected] * | ||
* * | ||
|
@@ -61,9 +61,11 @@ package Sempare.Template.Pkg; | |
|
||
requires | ||
rtl, | ||
dbrtl; | ||
dbrtl, | ||
vcl; | ||
|
||
contains | ||
Sempare.Template.BlockResolver in 'src\Sempare.Template.BlockResolver.pas', | ||
Sempare.Template.Visitor in 'src\Sempare.Template.Visitor.pas', | ||
Sempare.Template.Util in 'src\Sempare.Template.Util.pas', | ||
Sempare.Template.StackFrame in 'src\Sempare.Template.StackFrame.pas', | ||
|
@@ -79,6 +81,7 @@ contains | |
Sempare.Template in 'src\Sempare.Template.pas', | ||
Sempare.Template.JSON in 'src\Sempare.Template.JSON.pas', | ||
Sempare.Template.ResourceStrings in 'src\Sempare.Template.ResourceStrings.pas', | ||
Sempare.Template.VariableExtraction in 'src\Sempare.Template.VariableExtraction.pas'; | ||
Sempare.Template.VariableExtraction in 'src\Sempare.Template.VariableExtraction.pas', | ||
Sempare.Template.TemplateRegistry in 'src\Sempare.Template.TemplateRegistry.pas'; | ||
|
||
end. |
Oops, something went wrong.