Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
MarkdownToHtmlStat.cs
1using System.Threading.Tasks;
2using Waher.Script;
7
9{
14 {
24 {
25 }
26
30 public override string FunctionName => nameof(MarkdownToHtmlStat);
31
36 public override bool IsAsynchronous => true;
37
45 {
46 return this.EvaluateScalarAsync(Argument, Variables).Result;
47 }
48
55 public override async Task<IElement> EvaluateScalarAsync(string Argument, Variables Variables)
56 {
58
59 Argument = "BodyOnly: 1\r\n\r\n" + Argument;
60
62 Doc = await MarkdownDocument.CreateAsync(Argument, ParentSettings);
63 else
65
66 string Html = await Doc.GenerateHTML();
68
69 return new ObjectVector(new IElement[]
70 {
71 new StringValue(Html),
72 new ObjectValue(Statistics)
73 });
74 }
75
76 }
77}
MarkdownToHtmlStat(ScriptNode Argument, int Start, int Length, Expression Expression)
MarkdownToHtmlStat(x)
override string FunctionName
Name of the function
override IElement EvaluateScalar(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
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.
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.
async Task< string > GenerateHTML()
Generates HTML from the markdown text.
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.
Contains some basic statistical information about a Markdown document.
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