Ulito.Shablon 0.1.0

Shablon - template merge

Makes the task of creating and using templates much easier by using simple tokens in a file and annotations on a model.

Install-Package Ulito.Shablon -Version 0.1.0
dotnet add package Ulito.Shablon --version 0.1.0
<PackageReference Include="Ulito.Shablon" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ulito.Shablon --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Shablon

Created by Tony Kenny. November 2017

Please make suggestions for new features and feel free to contribute!

Introduction

Makes the task of creating and using templates much easier by using simple tokens in a file and annotations on a model.

No need to create a separate method for each template type you use. Just create your template and model, then call invoke the processor to work its magic.

Supports complex data types & collections.

Usage

See example project.

Create a template with some tokens (place holders)
Create a model with annotated public properties
Invoke the processor, sending the template, model and the strings you use as the token start and end.

template = Shablon.TemplateProcessor.ProcessTemplate(template, orderModel, "[#", "#]");

ValueTypes

Add annotation to a value type and strings to define the placeholder for auto replacement

NameValueCollections

These are a special case and easy to use. Both the name and the value can be output in the template with the special reserved tokens "_Name" and "_Value"

Notes

Replacements are global, so be careful not to use the same place holder in a model that contains complex types. For example, don't use "Name" for a customer on an invoice template then also use "Name" on a product. They will all get replaced with the same data!

Shablon

Created by Tony Kenny. November 2017

Please make suggestions for new features and feel free to contribute!

Introduction

Makes the task of creating and using templates much easier by using simple tokens in a file and annotations on a model.

No need to create a separate method for each template type you use. Just create your template and model, then call invoke the processor to work its magic.

Supports complex data types & collections.

Usage

See example project.

Create a template with some tokens (place holders)
Create a model with annotated public properties
Invoke the processor, sending the template, model and the strings you use as the token start and end.

template = Shablon.TemplateProcessor.ProcessTemplate(template, orderModel, "[#", "#]");

ValueTypes

Add annotation to a value type and strings to define the placeholder for auto replacement

NameValueCollections

These are a special case and easy to use. Both the name and the value can be output in the template with the special reserved tokens "_Name" and "_Value"

Notes

Replacements are global, so be careful not to use the same place holder in a model that contains complex types. For example, don't use "Name" for a customer on an invoice template then also use "Name" on a product. They will all get replaced with the same data!

Release Notes

Beta 1

Dependencies

This package has no dependencies.

Version History

Version Downloads Last updated
0.1.0 2,799 11/13/2017