Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
MarkdownStatistics.cs
1using System.Threading.Tasks;
2using Waher.Script;
6
8{
13 {
23 {
24 }
25
29 public override string FunctionName => nameof(MarkdownStatistics);
30
35 public override bool IsAsynchronous => true;
36
44 {
45 return this.EvaluateScalarAsync(Argument, Variables).Result;
46 }
47
54 public override async Task<IElement> EvaluateScalarAsync(string Argument, Variables Variables)
55 {
57
58 Argument = "BodyOnly: 1\r\n\r\n" + Argument;
59
61 Doc = await MarkdownDocument.CreateAsync(Argument, ParentSettings);
62 else
64
65 return new ObjectValue(Doc.GetStatistics());
66 }
67
68 }
69}
MarkdownStatistics(ScriptNode Argument, int Start, int Length, Expression Expression)
MarkdownStatistics(x)
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
override async Task< IElement > EvaluateScalarAsync(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
override string FunctionName
Name of the function
override IElement EvaluateScalar(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
Contains a markdown document. This markdown document class supports original markdown,...
MarkdownStatistics GetStatistics()
Returns some basic statistics about the contents of the Markdown object.
const string MarkdownSettingsVariableName
Variable name used for storing Markdown settings.
static Task< MarkdownDocument > CreateAsync(string MarkdownText, params Type[] TransparentExceptionTypes)
Contains a markdown document. This markdown document class supports original markdown,...
Contains settings that the Markdown parser uses to customize its behavior.
Class managing a script expression.
Definition: Expression.cs:39
Base class for funcions of one scalar string variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Contains information about a variable.
Definition: Variable.cs:10
Collection of variables.
Definition: Variables.cs:25
virtual bool TryGetVariable(string Name, out Variable Variable)
Tries to get a variable object, given its name.
Definition: Variables.cs:52
Basic interface for all types of elements.
Definition: IElement.cs:20