![]() |
VOOZH | about |
| Advisory: https://github.com/advisories/GHSA-5wr9-m6jw-xx44 | Severity: critical |
| Advisory: https://github.com/advisories/GHSA-x6m9-38vm-2xhf | Severity: high |
| Advisory: https://github.com/advisories/GHSA-c875-h985-hvrc | Severity: high |
| Advisory: https://github.com/advisories/GHSA-v66j-x4hw-fv9g | Severity: high |
| Advisory: https://github.com/advisories/GHSA-xcx6-vp38-8hr5 | Severity: high |
| Advisory: https://github.com/advisories/GHSA-wgh7-7m3c-fx25 | Severity: high |
| Advisory: https://github.com/advisories/GHSA-grr9-747v-xvcp | Severity: high |
| Advisory: https://github.com/advisories/GHSA-p6q4-fgr8-vx4p | Severity: high |
| Advisory: https://github.com/advisories/GHSA-24c8-4792-22hx | Severity: high |
| Advisory: https://github.com/advisories/GHSA-m2p3-hwv5-xpqw | Severity: moderate |
| Advisory: https://github.com/advisories/GHSA-5rpf-x9jg-8j5p | Severity: moderate |
| Advisory: https://github.com/advisories/GHSA-q6rr-fm2g-g5x8 | Severity: moderate |
| Advisory: https://github.com/advisories/GHSA-xw6w-9jjh-p9cr | Severity: moderate |
dotnet add package Scriban --version 6.5.5
NuGet\Install-Package Scriban -Version 6.5.5
<PackageReference Include="Scriban" Version="6.5.5" />
<PackageVersion Include="Scriban" Version="6.5.5" />Directory.Packages.props
<PackageReference Include="Scriban" />Project file
paket add Scriban --version 6.5.5
#r "nuget: Scriban, 6.5.5"
#:package Scriban@6.5.5
#addin nuget:?package=Scriban&version=6.5.5Install as a Cake Addin
#tool nuget:?package=Scriban&version=6.5.5Install as a Cake Tool
<img align="right" width="160px" height="160px" src="img/scriban.png">
Scriban is a fast, powerful, safe and lightweight scripting language and engine for .NET, which was primarily developed for text templating with a compatibility mode for parsing liquid templates.
Today, not only Scriban can be used in text templating scenarios, but also can be integrated as a general scripting engine: For example, Scriban is at the core of the scripting engine for kalk, a command line calculator application for developers.
// Parse a scriban template
var template = Template.Parse("Hello {{name}}!");
var result = template.Render(new { Name = "World" }); // => "Hello World!"
Parse a Liquid template using the Liquid language:
// Parse a liquid template
var template = Template.ParseLiquid("Hello {{name}}!");
var result = template.Render(new { Name = "World" }); // => "Hello World!"
The language is very versatile, easy to read and use, similar to liquid templates:
var template = Template.Parse(@"
<ul id='products'>
{{ for product in products }}
<li>
<h2>{{ product.name }}</h2>
Price: {{ product.price }}
{{ product.description | string.truncate 15 }}
</li>
{{ end }}
</ul>
");
var result = template.Render(new { Products = this.ProductList });
Scriban can also be used in pure scripting context without templating ({{ and }}) and can help you to create your own small DSL.
By default, Properties and methods of .NET objects are automatically exposed with lowercase and _ names. It means that a property like MyMethodIsNice will be exposed as my_method_is_nice. This is the default convention, originally to match the behavior of liquid templates.
If you want to change this behavior, you need to use a MemberRenamer delegate
ScriptVisitor. You can now access Parent on any ScriptNode object and navigate the AST.
{{ and exit}}0x1ef or 0b101010func sub(x,y = 1, z...); ret x - y - z[0]; endsub(x,y) = x - y?. instead of regular . (e.g a?.b?.c)cond ? a : bScriptLang enum) from template/scripting parsing mode (ScriptMode).Scientific, in addition to default Scriban and Liquid language mode.TemplateContext to define scripting behaviors (EnableRelaxedTargetAccess, EnableRelaxedMemberAccess, EnableRelaxedFunctionAccess, EnableRelaxedIndexerAccess, EnableNullIndexer)object.eval and object.eval_template function to evaluate Scriban expressions/templates at runtime.IFormattable objects.Template.ToText, allowing to manipulate scripts in memory and re-save them to the disk, useful for roundtrip script update scenariosliquid by using the Template.ParseLiquid method
liquid language is less powerful than scriban, this mode allows to migrate from liquid to scriban language easilyliquid script to a scriban script using Template.ToText on a template parsed with Template.ParseLiquidasync/await evaluation of scripts (e.g Template.RenderAsync)if/else/for/while, expressions (x = 1 + 2), conditions... etc.myvar | string.capitalize)
func statement and allow function pointers/delegates via the alias @ directivex = {mymember: 1}) and arrays (e.g x = [1,2,3,4])wrap statementarray, date, html, math, object, regex, string, timespan{{...}}You can install the Scriban Extension for Visual Studio Code to get syntax coloring for scriban scripts (without HTML) and scriban html files.
The full documentation is available at https://scriban.github.io.
Scriban is available as a NuGet package: 👁 NuGet
Compatible with the following .NET Standard 2.0+ (New in 3.0)
For support for older framework (.NET 3.5, 4.0, 4.5, .NET Standard 1.1, 1.3, they are only provided in older Scriban 2.x, which is no longer supported.
Also the Scriban.Signed NuGet package provides signed assemblies.
Starting with Scriban 3.2.1+, the package comes with source included so that you can internalize your usage of Scriban into your project. This can be useful in an environment where you can't easily consume NuGet references (e.g Roslyn Source Generators).
Currently, the Scriban sources are not set as readonly, so you should not modify Scriban sources in that mode as it will modify the sources for other projects using Scriban on your machine. Use this feature at your own risks!
In order to activate this feature you need to:
PackageScribanIncludeSource to true in your project:
<PropertyGroup>
<PackageScribanIncludeSource>true</PackageScribanIncludeSource>
</PropertyGroup>
IncludeAssets="Build" to the NuGet PackageReference for Scriban:
<ItemGroup>
<PackageReference Include="Scriban" Version="3.2.1" IncludeAssets="Build"/>
</ItemGroup>
If you are targeting netstandard2.0 or .NET Framework 4.7.2+, in order to compile Scriban you will need these NuGet package references (that can come from a dependency that you already have):
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.0" />
</ItemGroup>
In this mode, all Scriban types are marked as internal.
You should see a Scriban folder and empty subfolders in your project. This is an issue with Visual Studio 2019 16.8.x (and before) and it will be fixed in VS 2019 16.9+
This software is released under the BSD-Clause 2 license.
Supports this project with a monthly donation and help me continue improving it. [Become a sponsor]
<img src="https://github.com/lilith.png?size=200" width="64px;" style="border-radius: 50%" alt="lilith"/> Lilith River, author of Imageflow Server, an easy on-demand image editing, optimization, and delivery server
Adapted logo Puzzle by Andrew Doane from the Noun Project
Alexandre Mutel aka xoofx.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Scriban:
| Package | Downloads |
|---|---|
|
Volo.Abp.TextTemplating.Scriban
Package Description |
|
|
Serenity.CodeGenerator
Generates server and script side code for Serenity platform applications |
|
|
Miru.Core
Package Description |
|
|
Volo.Docs.Domain.Shared
Package Description |
|
|
RecommendationsGatewayModule.Data
Package Description |
Showing the top 20 popular GitHub repositories that depend on Scriban:
| Repository | Stars |
|---|---|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
|
|
|
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 11, 10, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
|
|
|
openiddict/openiddict-core
Flexible and versatile OAuth 2.0/OpenID Connect stack for .NET
|
|
|
focus-creative-games/luban
luban是一个强大、易用、优雅、稳定的游戏配置解决方案。luban is a powerful, easy-to-use, elegant and stable game configuration solution.
|
|
|
nuke-build/nuke
🏗 The AKEless Build System for C#/.NET
|
|
|
martinothamar/Mediator
A high performance implementation of Mediator pattern in .NET using source generators.
|
|
|
microsurging/surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. support Event-based Asynchronous Pattern and reactive programming.
|
|
|
GitTools/GitVersion
From git log to SemVer in no time
|
|
|
microsoft/onefuzz
A self-hosted Fuzzing-As-A-Service platform
|
|
|
serenity-is/Serenity
Business Apps Made Simple with Asp.Net Core MVC / TypeScript
|
|
|
belav/csharpier
CSharpier is an opinionated code formatter for c#.
|
|
|
sebastienros/fluid
Fluid is an open-source .NET template engine based on the Liquid template language.
|
|
|
statiqdev/Statiq
Statiq is a flexible static site generator written in .NET.
|
|
|
qq362946/Fantasy
C # Game Framework, but not limited to games. Can be used for non game business development
|
|
|
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK.
|
|
|
xoofx/ultra
An advanced profiler for .NET Applications on Windows
|
|
|
colinin/abp-next-admin
这是基于vue-vben-admin 模板适用于abp vNext的前端管理项目
|
|
|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
|
|
bing-framework/Bing.NetCore
Bing是基于 .net core 3.1 的框架,旨在提升团队的开发输出能力,由常用公共操作类(工具类、帮助类)、分层架构基类,第三方组件封装,第三方业务接口封装等组成。
|