2using System.Globalization;
4using System.Threading.Tasks;
85 while (!(Loop is
null))
87 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
123 if (
Element is Model.BlockElements.Table Table)
125 if (Table.Headers.Length == 1)
128 int i, Columns = Headers.Length;
129 string[] Headers2 =
new string[Columns];
130 int Rows = Table.Rows.Length;
135 for (i = 0; i < Columns; i++)
140 for (j = 0, d = Row.Length; j < d; j++)
153 ColumnNames = Headers2
159 else if (
Element is Model.BlockElements.CodeBlock CodeBlock)
161 string Language = CodeBlock.Language;
162 int i = Language.IndexOf(
':');
165 Language = Language.Substring(0, i);
167 switch (Language.ToLower())
170 return await Model.CodeContent.GraphContent.GetGraph(CodeBlock.Rows);
173 StringBuilder sb =
new StringBuilder();
175 foreach (
string Row
in CodeBlock.Rows)
198 await
Element.Render(Renderer2);
199 string s = Renderer2.
ToString().Trim();
201 if (
double.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out
double d))
211 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,...
ChunkedList< MarkdownElement > Elements
Markdown elements making up the document.
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.
static XmlDocument ParseXml(string Xml)
Parses an XML Document from its string representation.
Node referencing a chunk in a ChunkedList<T>
ChunkNode< T > Next
Next chunk
int Pos
Index after the last element in chunk.
int Start
Index of first element in chunk.
A chunked list is a linked list of chunks of objects of type T .
ChunkNode< T > FirstChunk
First chunk
void Add(T Item)
Adds an item to the collection.
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.
override string ToString()
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.