GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - okproject/TemplateEngine: A Template engine which allow to replace and hide some text (using boolean expression evaluator)

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
Perrich.TemplateEngine
Perrich.TemplateEngine
 
 
Perrich.TemplateEngineTest
Perrich.TemplateEngineTest
 
 
packages
packages
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Perrich.TemplateEngine.sln
Perrich.TemplateEngine.sln
 
 
README.md
README.md
 
 

Repository files navigation

TemplateEngine

A Template engine which allow to replace and hide some text (using boolean expression evaluator)

How to use it ?

  • create a tag used by the replacement behavior {tag=xxxx}
  • create a conditional part using boolean expression {if="condition"}...{/if}. A condition can manage multiple boolean variable, constant (true/false) and 3 boolean operators:
  • "!" as not
  • "&&" as and
  • "||" as or

Sample :

var dict = new Dictionary<string, bool> { { "Displayed", true } };
var replacements = new Dictionary<string, string> { { "value", "very small text" } };
var evaluator = new ExpressionEvaluator(dict, false);

var engine = new TemplateEngine.TemplateEngine(evaluator, false, false, replacements);
string result = engine.Apply(@"It's a sample with {if=""Displayed || true""}a displayed {tag=value}.{/if}{if=""!Displayed""}nothing.{/if}");

Used library:

  • NUnit 2.6.3 for unit tests

License:

Copyright 2014-2015 PERRICHOT Florian

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A Template engine which allow to replace and hide some text (using boolean expression evaluator)

Resources

Readme
Apache-2.0 license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.