Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Template engine in .NET

Tags:

.net

I am looking for a template engine to be used in .NET. Coming from python, I know jinja, but I was not able to find anything similar. My use case is to create SQL queries starting from vb.net objects containing information on which columns to take (eventual aliases), which tables to join...

like image 695
pietroppeter Avatar asked Mar 28 '26 13:03

pietroppeter


1 Answers

There is a templating engine in .NET called Scriban (https://github.com/lunet-io/scriban), written in C#. While it was directly inspired by Shopify's liquid templating (originally written in Ruby) which is quite similar, at least in spirit, to Jinja, the author of Scriban actually admits to have been strongly influenced by Jinja.

I have subsequently extended Scriban to include things like layouts (which are called template inheritance in Jinja) and sections (called blocks in Jinja). My extension is called Scriptic and lives here on GitHub. This is the closest thing to Jinja (the Pythonic templating engine) I know on .NET.

like image 170
Optimax Avatar answered Mar 30 '26 12:03

Optimax



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!