Questions tagged [scriban]

Scriban is a templating language for parsing text documents in .NET.

32 questions
0
votes
0 answers

Scriban , how to use something else then "{{" "}}"

I'm trying to use Scriban in a C# code to replace some place holders in my text file, but my text file contain "{{" and "}}" already, is there anyway to use some custom delimiters ? thank you in advance
Maroine Abdellah
  • 576
  • 1
  • 5
  • 21
0
votes
0 answers

force it to use a specific formatter for Scriban-HTML?

I am using Scriban to create an HTML template that will be filled out by my program. I am editing the template in VS Code - so far I've found a syntax highlighter but no dice with formatting. This is what it looks like when I enter code and save the…
zkdr
  • 83
  • 11
0
votes
1 answer

How to format strings and hexadecimals in Scriban

I am writing C# solution that generates a C++ file base on some configuration. For this i am using Scriban as a template engine. I saw the following statement before in Jinja2: uint16_t {{"%25s"|format(device.name)}} =…
El-Zinkii
  • 3
  • 1
  • 2
0
votes
0 answers

How to call google map API inside a javascript file in Sitecore SXA

I wanted to create a custom map via scriban in sxa, but I can't access the google api inside a javascript file. I try this code: (function ($) { $(document).ready(function () { if ($(".property-map").length > 0) { //…
0
votes
0 answers

Scriban - $ prefixed vars are not being parsed

I have been trying to include some system vars prefixed with $ like $SYSTEM_VAR but these vars not being parsed, only if i remove the $ sign. I have also tried with @ symbol with similar results. Thanks,
Rameez Raja
  • 302
  • 1
  • 13
0
votes
0 answers

Image wont show

I'm trying to convert html to pdf, so I used Scriban library to parse the html and the ItextSharp to create the pdf, every think worked fine until I added an image. The image want display dispite a true path. Here is the code I used: public…
0
votes
0 answers

Can't able to use Scriban reference dll in WPF Application (.NET Framework)

I am using Scriban reference dll of version 5.5.0. I am trying to add this reference file in my WPF application or XAML file used application while adding it shows error in the XAML file InitializeComponent() as [Error CS0103 The name…
sadhiq24
  • 1
  • 2
0
votes
1 answer

Are there any issues with using Razor as a object-oriented code generator?

I've been experimenting with T4 templates to generate code for classes with methods and attributes. While it's serves my purpose, it's missing some highly desirable productivity features such as syntax highlighting, snippets and Templates on the…
ATL_DEV
  • 9,256
  • 11
  • 60
  • 102
0
votes
1 answer

How to fix the problem of Sitecore position fixed in Experience editor? - SXA 9.3

How to fix the problem of having the navbar as position: fixed in Sitecore 9.3. I saw some solutions on the blogs, but it only fixes the issue on the Sitecore 8 versions. Basically when I open the partial design in Sitecore Experience Editor, I have…
Samke11
  • 385
  • 5
  • 17
0
votes
1 answer

Sitecore SXA - Scriban error with sc_beginfield, can't be found

I am getting this kinda issue with my scriban variants ˙error : The function `sc_beginfield` was not found. Here is the template: {{ sc_beginfield i_item 'Link' [['text', ' ']]}} {{ sc_link_text i_item 'Link' }}
Samke11
  • 385
  • 5
  • 17
0
votes
1 answer

Replace Dictionary values In Scriban template Engine

I am trying to use Scriban template engine for replacing the Dictionary Values. For Example string bodyText = "Hi, The following service(s) has reported issues. {{emailContent}} Thanks " ; Dictionary
user2911592
  • 91
  • 12
0
votes
1 answer

Is there a way to index through objects dnyamically in Scriban with C#?

Working on a PDF generator and it uses the Templating Engine Scriban and LaTeX. Although I cannot seem to reference the C# object Scriban is trying to read via index notation (use the data at this index of the array). I mean something like…
tblev
  • 422
  • 4
  • 13
0
votes
0 answers

C# Template Engine which supports iterating through data rows in DataTable

I'm looking for a C# template engine which supports iterating through data rows in DataTable. Something like, var template = Template.Parse(@"
    {{ for dr in ds.tables[0].rows }}
  • {{ dr[0]…

Baga
  • 1,354
  • 13
  • 24
0
votes
0 answers

Getting multiple values from a string with delimiters

I am using Scriban to render a html template from a dynamic object and a html template in the form of a string. I am trying to validate that the dynamic object contains all the field that i need to fill into the template. To do this, i need to find…
Bille
  • 371
  • 6
  • 15
0
votes
1 answer

Does Member Renamer have any impact to performance

Does using Member Renamer have any performance impact because it will be doing it via Reflection: https://github.com/lunet-io/scriban/blob/master/doc/runtime.md#member-renamer
iMatoria
  • 1,450
  • 2
  • 19
  • 35