BadScript 2
Loading...
Searching...
No Matches
BadHtmlApi.cs
Go to the documentation of this file.
1using BadHtml;
2
5
10
14[BadInteropApi("BadHtml")]
15internal partial class BadHtmlApi
16{
17 [BadMethod(description: "Runs a BadHtml Template")]
18 [return: BadReturn("The string result of the html transformation")]
19 private string Run(
20 BadExecutionContext context,
21 [BadParameter(description: "The Template File")]
22 string file,
23 [BadParameter(description: "The Model")]
24 BadObject? model = null,
25 [BadParameter(description: "If True, empty text nodes are omitted from the output html")]
26 bool skipEmptyTextNodes = false)
27 {
28 BadHtmlTemplate template = BadHtmlTemplate.Create(file);
29
31 options.SkipEmptyTextNodes = skipEmptyTextNodes;
32
33 return template.Run(model, options, context.Scope);
34 }
35}
Implements a Html Template.
static BadHtmlTemplate Create(string file, IFileSystem? fileSystem=null)
Creates a new Template.
Options for the Html Template Engine.
Implements the "BadHtml" API.
Definition BadHtmlApi.cs:16
string Run(BadExecutionContext context, [BadParameter(description:"The Template File")] string file, [BadParameter(description:"The Model")] BadObject? model=null, [BadParameter(description:"If True, empty text nodes are omitted from the output html")] bool skipEmptyTextNodes=false)
Definition BadHtmlApi.cs:19
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
A Html Template Generator based on BadScript2.
Contains HTML Extensions and APIs for the BadScript2 Runtime.
Definition BadHtmlApi.cs:9
Contains the Runtime Objects.
Definition BadArray.cs:10
Contains the Runtime Implementation.