2using System.Collections.Generic;
4using System.Threading.Tasks;
79 LinkedList<IElement> Results =
null;
92 Results =
new LinkedList<IElement>();
93 Results.AddLast(Result);
96 Results.AddLast(Item);
113 if (
Element is Model.BlockElements.Table Table)
115 if (Table.Headers.Length == 1)
118 int i, Columns = Headers.Length;
119 string[] Headers2 =
new string[Columns];
120 int Rows = Table.Rows.Length;
121 LinkedList<IElement> Elements =
new LinkedList<IElement>();
123 for (i = 0; i < Columns; i++)
124 Headers2[i] = (await
Evaluate(Headers[i])).AssociatedObjectValue?.ToString() ??
string.Empty;
133 Elements.AddLast(await
Evaluate(E));
139 ColumnNames = Headers2
145 else if (
Element is Model.BlockElements.CodeBlock CodeBlock)
147 string Language = CodeBlock.Language;
148 int i = Language.IndexOf(
':');
151 Language = Language.Substring(0, i);
153 switch (Language.ToLower())
156 return await Model.CodeContent.GraphContent.GetGraph(CodeBlock.Rows);
159 StringBuilder sb =
new StringBuilder();
161 foreach (
string Row
in CodeBlock.Rows)
164 XmlDocument Doc =
new XmlDocument();
165 Doc.LoadXml(sb.ToString());
185 await
Element.Render(Renderer2);
186 string s = Renderer2.
ToString().Trim();
198 else if (
Element is Model.SpanElements.InlineText)
Helps with parsing of commong data types.
static bool TryParse(string s, out double Value)
Tries to decode a string encoded double.
Converts markdown to an element.
override string FunctionName
Name of the function
FromMarkdown(ScriptNode Argument, int Start, int Length, Expression Expression)
Converts markdown to an element.
override IElement EvaluateScalar(string Argument, Variables Variables)
Evaluates the function.
static async Task< IElement > Evaluate(MarkdownElement Element)
Converts a Markdown element to a script element.
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
static async Task< IElement > Evaluate(string Argument, ScriptNode Node)
Converts a Markdown string to a script element.
override Task< IElement > EvaluateScalarAsync(string Argument, Variables Variables)
Evaluates the function.
Contains a markdown document. This markdown document class supports original markdown,...
static Task< MarkdownDocument > CreateAsync(string MarkdownText, params Type[] TransparentExceptionTypes)
Contains a markdown document. This markdown document class supports original markdown,...
Abstract base class for all markdown elements.
Abstract base class for Markdown renderers.
override string ToString()
Returns the renderer output.
Renders plain text from a Markdown document.
Helps with common XML-related tasks.
static bool TryParse(string s, out DateTime Value)
Tries to decode a string encoded DateTime.
Base class for all types of elements.
Class managing a script expression.
Handles bitmap-based graphs.
Base class for funcions of one scalar string variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
int Start
Start position in script expression.
static bool TryParse(string s, out Measurement Value)
Tries to parse a string to a physical quantity.
static readonly ObjectValue Null
Null value.
static bool TryParse(string s, out PhysicalQuantity Value)
Tries to parse a string to a physical quantity.
static IElement Encapsulate(Array Elements, bool CanEncapsulateAsMatrix, ScriptNode Node)
Encapsulates the elements of a vector.
Interface for all markdown handlers of code content that generates an image output.
Interface for code content HTML renderers.
Basic interface for all types of elements.