Skip to main content

Namespace ServiceStack.Script

Classes​

BindingExpressionException​

CallExpressionUtils​

CaptureScriptBlock​

Captures the output and assigns it to the specified variable. Accepts an optional Object Dictionary as scope arguments when evaluating body.

Usages: {{#capture output}} {{#each args}} - {{it}} {{/each}} {{/capture}} {{#capture output {nums:[1,2,3]} }} {{#each nums}} {{it}} {{/each}} {{/capture}} {{#capture appendTo output {nums:[1,2,3]} }} {{#each nums}} {{it}} {{/each}} {{/capture}}

CsvScriptBlock​

Parse csv contents into a string dictionary List and assign to identifier Usage: {{#csv list}} Item,Qty Apples,2 Oranges,3 {{/csv}}

DefaultScriptBlocks​

DefaultScripts​

DefnScriptBlock​

Define and export a LISP function to the page Usage: {{#defn calc [a, b] }} (let ( (c (* a b)) ) (+ a b c) ) {{/defn}}

DirectoryScripts​

EachScriptBlock​

Handlebars.js like each block Usages: {{#each customers}} {{Name}} {{/each}} {{#each customers}} {{it.Name}} {{/each}} {{#each num in numbers}} {{num}} {{/each}} {{#each num in [1,2,3]}} {{num}} {{/each}} {{#each numbers}} {{it}} {{else}} no numbers {{/each}} {{#each numbers}} {{it}} {{else if letters != null}} has letters {{else}} no numbers {{/each}} {{#each n in numbers where n > 5}} {{it}} {{else}} no numbers > 5 {{/each}} {{#each n in numbers where n > 5 orderby n skip 1 take 2}} {{it}} {{else}} no numbers > 5 {{/each}}

EvalScriptBlock​

Special block which evaluates the rendered body as a ServiceStack Template

Usages: {{#eval}}emit {{evaluateBodyOfArg}} at {{now}} {{/eval}}

{{#eval {scopeArg:1} }} emit {{evaluateBodyOfArg}} at {{now}} with {{scopeArg}} {{/eval}}

{{#eval {htmlDecode:true} }} emit htmldecoded {{evaluateBodyOfArg}} at {{now}} {{/eval}}

{{#eval {use:{methods:'ServiceStackScripts',plugins:['MarkdownScriptPlugin']} }} emit {{evaluateBodyOfArg}} at {{now}} in new context {{/eval}}

{{#eval { use:{context:true} } }} emit {{evaluateBodyOfArg}} in host context {{/eval}}

FileScripts​

FunctionScriptBlock​

Define a reusable function Usage: {{#function calc(a, b) }} a * b | to => c a + b + c | return {{/function}}

GitHubPlugin​

GitHubScripts​

HtmlPageFormat​

HtmlScriptBlocks​

HtmlScripts​

IfScriptBlock​

Handlebars.js like if block Usages: {{#if a > b}} max {{a}} {{/if}} {{#if a > b}} max {{a}} {{else}} max {{b}} {{/if}} {{#if a > b}} max {{a}} {{else if b > c}} max {{b}} {{else}} max {{c}} {{/if}}

IgnoreResult​

JsAddition​

JsAnd​

JsArrayExpression​

JsArrowFunctionExpression​

JsAssignment​

JsAssignmentExpression​

JsBinaryExpression​

JsBinaryOperator​

JsBitwiseAnd​

JsBitwiseLeftShift​

JsBitwiseNot​

JsBitwiseOr​

JsBitwiseRightShift​

JsBitwiseXOr​

JsBlockStatement​

JsCallExpression​

JsCoalescing​

JsConditionalExpression​

JsDeclaration​

JsDivision​

JsEquals​

JsExpression​

JsExpressionStatement​

JsExpressionUtils​

JsFilterExpressionStatement​

JsGreaterThan​

JsGreaterThanEqual​

JsIdentifier​

JsLessThan​

JsLessThanEqual​

JsLiteral​

JsLogicalExpression​

JsLogicOperator​

JsMemberExpression​

JsMinus​

JsMod​

JsMultiplication​

JsNot​

JsNotEquals​

JsNull​

JsObjectExpression​

JsOperator​

JsOr​

JsPageBlockFragmentStatement​

JsPlus​

JsProperty​

JsSpreadElement​

JsStatement​

JsStrictEquals​

JsStrictNotEquals​

JsSubtraction​

JsTemplateElement​

JsTemplateElementValue​

JsTemplateLiteral​

JsToken​

JsTokenUtils​

JsUnaryExpression​

JsUnaryOperator​

JsVariableDeclaration​

KeyValuesScriptBlock​

Parse text contents into a list of string Key/Value pairs and assign to specified identifier Usage: {{#keyvalues list}} Apples 2 Oranges 3 {{/keyvalues}} {{#keyvalues list ':'}} Grape Fruit: 2 Rock Melon: 3 {{/keyvalues}}

Lisp​

A Lisp interpreter written in C# 7

This is ported from Nuka Lisp in Dart (https://github.com/nukata/lisp-in-dart) except for bignum. It is named after ex-Nukata Town in Japan.

Lisp.BuiltInFunc​

Built-in function

Lisp.Cell​

Cons cell

Lisp.Interpreter​

Core of the Lisp interpreter

Lisp.LispFunc​

Common base class of Lisp functions

Lisp.Reader​

Reader of Lisp expressions

Lisp.Sym​

Lisp symbol

LispEvalException​

Exception in evaluation

LispScriptMethods​

LispStatements​

MarkdownTable​

NoopScriptBlock​

Handlebars.js like noop block Usage: Remove {{#noop}} contents in here {{/noop}}

PageBlockFragment​

PageElseBlock​

PageFormat​

PageFragment​

PageJsBlockStatementFragment​

PageLispStatementFragment​

PageResult​

PageStringFragment​

PageVariableFragment​

PartialScriptBlock​

Partial Block doesn't emit anything it only creates and saves a partial in the PageResult

Usages: {{#partial mypartial}} contents {{/partial}} {{#partial mypartial {format:'html'} }} contents {{/partial}} {{#partial mypartial {format:'html', pageArg:1} }} contents {{/partial}}

ProtectedScriptBlocks​

ProtectedScripts​

RawScriptBlock​

Special block which captures the raw body as a string fragment

Usages: {{#raw}}emit {{ verbatim }} body{{/raw}} {{#raw varname}}assigned to varname{{/raw}} {{#raw appendTo varname}}appended to varname{{/raw}}

RawString​

ReturnValue​

ScopeVars​

ScriptABlock​

ScriptBBlock​

ScriptBlock​

ScriptButtonBlock​

ScriptCode​

Inverse of the #Script Language Template Syntax where each line is a statement i.e. in contrast to #Script's default where text contains embedded template expressions {{ ... }}

ScriptCodeUtils​

ScriptConfig​

ScriptConstants​

ScriptContext​

ScriptContextUtils​

ScriptDdBlock​

ScriptDivBlock​

ScriptDlBlock​

ScriptDtBlock​

ScriptEmBlock​

ScriptException​

ScriptExtensions​

ScriptFormBlock​

ScriptHtmlBlock​

ScriptIBlock​

ScriptImgBlock​

ScriptInputBlock​

ScriptLanguage​

ScriptLiBlock​

ScriptLinkBlock​

ScriptLisp​

ScriptLispUtils​

ScriptMetaBlock​

ScriptMethodInfo​

ScriptMethods​

ScriptOlBlock​

ScriptOptionBlock​

ScriptPBlock​

ScriptPreprocessors​

ScriptScopeContextUtils​

ScriptScriptBlock​

ScriptSelectBlock​

ScriptSpanBlock​

ScriptStrongBlock​

ScriptStyleBlock​

ScriptTableBlock​

ScriptTBodyBlock​

ScriptTdBlock​

ScriptTemplate​

The #Script Default Template Language (does not process lang ... blocks)

ScriptTemplateUtils​

ScriptTextAreaBlock​

ScriptTFootBlock​

ScriptTHeadBlock​

ScriptTrBlock​

ScriptUlBlock​

ScriptVerbatim​

SharpCodePage​

SharpPage​

SharpPages​

SharpPartialPage​

SharpScript​

#Script Language which processes lang ... blocks

StopExecution​

StopFilterExecutionException​

SyntaxErrorException​

TemplateFilterUtils​

WhileScriptBlock​

while block Usages: {{#while times > 0}} {{times}}. {{times - 1 | to => times}} {{/while}} {{#while b}} {{ false | to => b }} {{else}} {{b}} was false {{/while}}

Max Iterations = Context.Args[ScriptConstants.MaxQuota]

WithScriptBlock​

Handlebars.js like with block Usages: {{#with person}} Hi {{name}}, I'm {{age}} years old{{/with}} {{#with person}} Hi {{name}}, I'm {{age}} years old {{else}} no person {{/with}}

Structs​

ScriptScopeContext​

SpanJsToken​

Interfaces​

IConfigurePageResult​

IConfigureScriptContext​

IOScript​

IPageResult​

IResultInstruction​

IScriptPlugin​

IScriptPluginAfter​

IScriptPluginBefore​

ISharpPages​

Enums​

InvokerType​

JsVariableDeclarationKind​