3using System.Collections.Generic;
6using System.Threading.Tasks;
82 bool LetterOrUnderscore =
false;
83 StringBuilder sb =
new StringBuilder();
85 foreach (
char ch
in Path.ChangeExtension(FileName,
null))
87 if (
char.IsLetter(ch) || ch ==
'_')
90 LetterOrUnderscore =
true;
92 else if (
char.IsDigit(ch))
94 if (!LetterOrUnderscore)
97 LetterOrUnderscore =
true;
105 LetterOrUnderscore =
true;
109 string Name = sb.ToString();
111 this.
Output.Append(
"function CreateInnerHTML");
113 this.
Output.AppendLine(
"(ElementId, Args)");
114 this.
Output.AppendLine(
"{");
115 this.
Output.AppendLine(
"\tvar Element = document.getElementById(ElementId);");
116 this.
Output.AppendLine(
"\tif (Element)");
117 this.
Output.Append(
"\t\tElement.innerHTML = CreateHTML");
119 this.
Output.AppendLine(
"(Args);");
120 this.
Output.AppendLine(
"}");
122 this.
Output.Append(
"function CreateHTML");
124 this.
Output.AppendLine(
"(Args)");
125 this.
Output.AppendLine(
"{");
126 this.
Output.Append(
"\tvar Segments = [");
128 this.firstSegment =
true;
130 return Task.CompletedTask;
133 private bool firstSegment;
135 private void AppendHtml(
string Html)
137 this.AppendHtml(Html,
false,
false);
140 private void AppendHtml(
string Html,
bool Script,
bool AppendNewLine)
142 if (this.firstSegment)
143 this.firstSegment =
false;
148 this.
Output.Append(
"\t\t");
158 this.
Output.Append(jsonEncodedNewLine);
164 private void AppendHtmlLine()
166 this.AppendHtml(
string.Empty,
false,
true);
169 private void AppendHtmlLine(
string Html)
171 this.AppendHtml(Html,
false,
true);
174 private static readonly
string jsonEncodedNewLine =
JSON.
Encode(Environment.NewLine);
181 this.AppendHtmlLine(
"<div class=\"footnotes\">");
182 this.AppendHtmlLine(
"<hr />");
183 this.AppendHtmlLine(
"<ol>");
187 if ((this.
Document?.TryGetFootnoteNumber(Key, out
int Nr) ??
false) &&
191 this.AppendHtml(
"<li id=\"fn-" + Nr.ToString() +
"\">");
198 P.AddChildren(Backlink);
202 Footnote.BacklinkAdded =
true;
207 this.AppendHtmlLine(
"</li>");
211 this.AppendHtmlLine(
"</ol>");
212 this.AppendHtmlLine(
"</div>");
220 this.
Output.AppendLine(
"];");
221 this.
Output.AppendLine(
"\treturn Segments.join(\"\");");
222 this.
Output.AppendLine(
"}");
224 return Task.CompletedTask;
227 #region Span Elements
235 this.AppendHtml(
"<abbr data-title=\"" +
240 this.AppendHtml(
"</abbr>");
249 string s = Element.
EMail;
250 byte[] Data = Encoding.ASCII.GetBytes(s);
251 StringBuilder sb =
new StringBuilder();
253 foreach (
byte b
in Data)
256 sb.Append(b.ToString(
"X2"));
263 Data = Encoding.ASCII.GetBytes(
"mailto:");
264 foreach (
byte b
in Data)
267 sb.Append(b.ToString(
"X2"));
271 this.AppendHtml(
"<a href=\"" + sb.ToString() + s +
"\">" + s +
"</a>");
273 return Task.CompletedTask;
282 bool IsRelative = Element.
URL.IndexOf(
':') < 0;
284 this.AppendHtml(
"<a href=\"" +
288 this.AppendHtml(
"\" target=\"_blank");
292 return Task.CompletedTask;
301 this.AppendHtml(
"<del>");
303 this.AppendHtml(
"</del>");
326 if (EmojiSource is
null)
332 StringBuilder sb =
new StringBuilder();
334 this.AppendHtml(sb.ToString());
337 return Task.CompletedTask;
346 this.AppendHtml(
"<em>");
348 this.AppendHtml(
"</em>");
363 await this.
Render(Footnote);
364 else if (this.
Document?.TryGetFootnoteNumber(Element.
Key, out
int Nr) ??
false)
368 this.AppendHtml(
"<sup id=\"fnref-" + s +
"\"><a href=\"#fn-" + s +
369 "\" class=\"footnote-ref\">" + s +
"</a></sup>");
372 Footnote.Referenced =
true;
382 this.AppendHtml(
"<mark");
384 string s = this.htmlSettings?.HashtagClass;
386 if (!
string.IsNullOrEmpty(s))
389 s = this.htmlSettings?.HashtagClickScript;
391 if (!
string.IsNullOrEmpty(s))
394 this.AppendHtml(
">" + Element.
Tag +
"</mark>");
396 return Task.CompletedTask;
405 if (this.htmlSettings?.XmlEntitiesOnly ??
true)
415 this.AppendHtml(
"&" + Element.
Entity +
";");
422 this.AppendHtml(
"&" + Element.
Entity.ToLower() +
";");
426 string s = Html.HtmlEntity.EntityToCharacter(Element.
Entity);
427 if (!
string.IsNullOrEmpty(s))
433 this.AppendHtml(
"&" + Element.
Entity +
";");
435 return Task.CompletedTask;
444 this.AppendHtml(
"&#" + Element.
Code.ToString() +
";");
446 return Task.CompletedTask;
457 return Task.CompletedTask;
466 this.AppendHtml(Element.
HTML);
468 return Task.CompletedTask;
478 return Task.CompletedTask;
492 if (Result is XmlDocument Xml)
497 if (Result is
Graph G)
502 if (AloneInParagraph)
503 this.AppendHtml(
"<figure>");
507 "\" src=\"data:image/png;base64," + Convert.ToBase64String(Bin, 0, Bin.Length) +
513 this.AppendHtml(
"Graph");
515 this.AppendHtml(
"\" />");
517 if (AloneInParagraph)
518 this.AppendHtml(
"</figure>");
522 byte[] Bin = Pixels.EncodeAsPng();
524 if (AloneInParagraph)
525 this.AppendHtml(
"<figure>");
527 this.AppendHtml(
"<img border=\"2\" width=\"" + Pixels.Width.ToString() +
528 "\" height=\"" + Pixels.Height.ToString() +
"\" src=\"data:image/png;base64," +
529 Convert.ToBase64String(Bin, 0, Bin.Length) +
"\" alt=\"Image\" />");
531 if (AloneInParagraph)
532 this.AppendHtml(
"</figure>");
534 else if (Result is SKImage Img)
536 using (SKData Data = Img.Encode(SKEncodedImageFormat.Png, 100))
538 byte[] Bin = Data.ToArray();
540 if (AloneInParagraph)
541 this.AppendHtml(
"<figure>");
543 this.AppendHtml(
"<img border=\"2\" width=\"" + Img.Width.ToString() +
544 "\" height=\"" + Img.Height.ToString() +
"\" src=\"data:image/png;base64," +
545 Convert.ToBase64String(Bin, 0, Bin.Length) +
"\" alt=\"Image\" />");
547 if (AloneInParagraph)
548 this.AppendHtml(
"</figure>");
554 Doc.ProcessAsyncTasks();
560 Doc.ProcessAsyncTasks();
562 else if (Result is Exception ex)
566 this.AppendHtmlLine(
"<font class=\"error\">");
568 if (ex is AggregateException ex2)
570 foreach (Exception ex3
in ex2.InnerExceptions)
575 if (AloneInParagraph)
576 this.AppendHtml(
"<p>");
580 if (AloneInParagraph)
581 this.AppendHtml(
"</p>");
584 this.AppendHtmlLine(
"</font>");
586 else if (Result is
ObjectMatrix M && !(M.ColumnNames is
null))
588 this.AppendHtml(
"<table><thead><tr>");
590 foreach (
string s2
in M.ColumnNames)
593 this.AppendHtml(
"</tr></thead><tbody>");
597 for (y = 0; y < M.Rows; y++)
599 this.AppendHtml(
"<tr>");
601 for (x = 0; x < M.Columns; x++)
603 this.AppendHtml(
"<td>");
605 object Item = M.GetElement(x, y).AssociatedObjectValue;
608 if (Item is
string s2)
611 await Element.Render(
this);
616 this.AppendHtml(
"</td>");
619 this.AppendHtml(
"</tr>");
622 this.AppendHtml(
"</tbody></table>");
624 else if (Result is Array A)
626 foreach (
object Item
in A)
631 if (AloneInParagraph)
632 this.AppendHtml(
"<p>");
636 if (AloneInParagraph)
637 this.AppendHtml(
"</p>");
640 if (AloneInParagraph)
641 this.AppendHtmlLine();
644 private static string FormatText(
string s)
646 return s.Replace(
"\r\n",
"\n").Replace(
"\n",
"<br/>").Replace(
"\r",
"<br/>").
647 Replace(
"\t",
" ").Replace(
" ",
" ");
658 return Task.CompletedTask;
667 this.AppendHtml(
"<ins>");
669 this.AppendHtml(
"</ins>");
678 this.AppendHtmlLine(
"<br/>");
680 return Task.CompletedTask;
701 bool IsRelative = Url.IndexOf(
':') < 0;
703 if (!IsRelative && Url.StartsWith(
"javascript:", StringComparison.OrdinalIgnoreCase))
705 this.AppendHtml(
"<a href=\"#\" onclick=\"" +
713 if (!
string.IsNullOrEmpty(Title))
717 this.AppendHtml(
"\" target=\"_blank");
719 this.AppendHtml(
"\">");
724 this.AppendHtml(
"</a>");
747 bool FirstOnRow =
true;
749 if (Element.
TryGetMetaData(out KeyValuePair<string, bool>[] Values))
751 foreach (KeyValuePair<string, bool> P
in Values)
756 this.AppendHtml(
" ");
761 this.AppendHtmlLine(
"<br/>");
767 return Task.CompletedTask;
784 this.AppendHtml(Renderer2.
ToString());
805 this.AppendHtml(Renderer2.
ToString());
819 this.AppendHtml(
"<s>");
821 this.AppendHtml(
"</s>");
830 this.AppendHtml(
"<strong>");
832 this.AppendHtml(
"</strong>");
841 this.AppendHtml(
"<sub>");
843 this.AppendHtml(
"</sub>");
852 this.AppendHtml(
"<sup>");
854 this.AppendHtml(
"</sup>");
863 this.AppendHtml(
"<u>");
865 this.AppendHtml(
"</u>");
870 #region Block elements
878 this.AppendHtmlLine(
"<blockquote>");
880 this.AppendHtmlLine(
"</blockquote>");
889 this.AppendHtmlLine(
"<ul>");
891 this.AppendHtmlLine(
"</ul>");
900 this.AppendHtmlLine(
"<div class='horizontalAlignCenter'>");
902 this.AppendHtmlLine(
"</div>");
922 this.AppendHtml(Renderer2.
ToString());
929 this.AppendHtmlLine(
"<font class=\"error\">");
931 if (ex is AggregateException ex2)
933 foreach (Exception ex3
in ex2.InnerExceptions)
939 this.AppendHtml(
"</font>");
945 this.AppendHtml(
"<pre><code class=\"");
947 if (
string.IsNullOrEmpty(Element.
Language))
948 this.AppendHtml(
"nohighlight");
952 this.AppendHtml(
"\">");
954 for (i = Element.
Start; i <= Element.
End; i++)
957 this.AppendHtmlLine(
"</code></pre>");
966 return Task.CompletedTask;
977 this.AppendHtml(
"<dd>");
979 this.AppendHtmlLine(
"</dd>");
989 this.AppendHtmlLine(
"<dl>");
991 this.AppendHtmlLine(
"</dl>");
1002 this.AppendHtml(
"<dt>");
1004 this.AppendHtmlLine(
"</dt>");
1014 this.AppendHtmlLine(
"<blockquote class=\"deleted\">");
1019 this.AppendHtmlLine(
"</blockquote>");
1037 this.AppendHtml(
"<h" + Element.
Level.ToString());
1039 string Id = await Element.
Id;
1041 if (!
string.IsNullOrEmpty(Id))
1045 this.AppendHtml(
" class=\"tocReference\"");
1047 this.AppendHtml(
">");
1051 this.AppendHtmlLine(
"</h" + Element.
Level.ToString() +
">");
1060 this.AppendHtmlLine(
"<hr/>");
1062 return Task.CompletedTask;
1072 this.AppendHtmlLine();
1081 this.AppendHtmlLine(
"<blockquote class=\"inserted\">");
1083 this.AppendHtmlLine(
"</blockquote>");
1092 return Task.CompletedTask;
1101 this.AppendHtmlLine(
"<div class='horizontalAlignLeft'>");
1103 this.AppendHtmlLine(
"</div>");
1112 this.AppendHtmlLine(
"<div class='horizontalAlignMargins'>");
1114 this.AppendHtmlLine(
"</div>");
1133 this.AppendHtml(
"<li value=\"" + Element.
Number.ToString() +
"\">");
1135 this.AppendHtml(
"<li>");
1139 this.AppendHtmlLine(
"</li>");
1151 this.AppendHtmlLine(
"<ol>");
1160 else if (Item.Number == Expected)
1162 this.AppendHtml(
"<li>");
1163 await Item.Child.Render(
this);
1164 this.AppendHtmlLine(
"</li>");
1168 await Item.Render(
this);
1169 Expected = Item.Number;
1173 this.AppendHtmlLine(
"</ol>");
1183 this.AppendHtml(
"<p>");
1188 this.AppendHtmlLine(
"</p>");
1197 this.AppendHtmlLine(
"<div class='horizontalAlignRight'>");
1199 this.AppendHtmlLine(
"</div>");
1210 this.AppendHtmlLine(
"</section>");
1213 private void GenerateSectionHTML(
int NrColumns)
1215 this.AppendHtml(
"<section");
1219 string s = NrColumns.ToString();
1221 this.AppendHtml(
" style=\"-webkit-column-count:" + s +
";-moz-column-count:" +
1222 s +
";column-count:" + s +
"\"");
1225 this.AppendHtmlLine(
">");
1234 this.AppendHtmlLine(
"</section>");
1235 this.GenerateSectionHTML(Element.
NrColumns);
1237 return Task.CompletedTask;
1249 int NrRows, RowIndex;
1250 int NrColumns = Element.
Columns;
1252 bool OnlyRows =
false;
1254 if (Element.
Headers.Length == 0 && !(
this.Document?.Elements is
null))
1259 if (Child != Element)
1269 this.AppendHtmlLine(
"<table>");
1271 if (!
string.IsNullOrEmpty(Element.
Id))
1275 if (
string.IsNullOrEmpty(Element.
Caption))
1280 this.AppendHtmlLine(
"</caption>");
1283 this.AppendHtmlLine(
"<colgroup>");
1286 this.AppendHtmlLine(
"<col style=\"text-align:" + Alignment.ToString().ToLower() +
"\"/>");
1288 this.AppendHtmlLine(
"</colgroup>");
1290 this.AppendHtmlLine(
"<thead>");
1292 NrRows = Element.
Headers.Length;
1293 for (RowIndex = 0; RowIndex < NrRows; RowIndex++)
1295 Row = Element.
Headers[RowIndex];
1298 this.AppendHtmlLine(
"<tr>");
1300 for (i = 0; i < NrColumns; i++)
1308 while (j < NrColumns && Row[j++] is
null)
1311 this.AppendHtml(
"<th style=\"text-align:" +
1315 this.AppendHtml(
"\" colspan=\"" + k.ToString());
1317 this.AppendHtml(
"\">");
1319 this.AppendHtmlLine(
"</th>");
1322 this.AppendHtmlLine(
"</tr>");
1324 this.AppendHtmlLine(
"</thead>");
1326 this.AppendHtmlLine(
"<tbody>");
1329 NrRows = Element.
Rows.Length;
1330 for (RowIndex = 0; RowIndex < NrRows; RowIndex++)
1332 Row = Element.
Rows[RowIndex];
1335 this.AppendHtmlLine(
"<tr>");
1337 for (i = 0; i < NrColumns; i++)
1345 while (j < NrColumns && Row[j++] is
null)
1348 this.AppendHtml(
"<td style=\"text-align:" +
1352 this.AppendHtml(
"\" colspan=\"" + k.ToString());
1354 this.AppendHtml(
"\">");
1356 this.AppendHtmlLine(
"</td>");
1359 this.AppendHtmlLine(
"</tr>");
1364 this.AppendHtmlLine(
"</tbody>");
1365 this.AppendHtmlLine(
"</table>");
1375 this.AppendHtml(
"<li class=\"taskListItem\"><input disabled=\"disabled");
1379 this.AppendHtml(
"\" id=\"item" + Element.
CheckPosition.ToString() +
1383 this.AppendHtml(
"\" type=\"checkbox\"");
1386 this.AppendHtml(
" checked=\"checked\"");
1388 this.AppendHtml(
"/><span></span><label class=\"taskListItemLabel\"");
1391 this.AppendHtml(
" for=\"item" + Element.
CheckPosition.ToString() +
"\"");
1393 this.AppendHtml(
">");
1397 bool EndLabel =
true;
1418 this.AppendHtml(
"</label>");
1427 this.AppendHtml(
"</label>");
1429 this.AppendHtmlLine(
"</li>");
1434 this.AppendHtmlLine(
"</label></li>");
1444 this.AppendHtmlLine(
"<ul class=\"taskList\">");
1446 this.AppendHtmlLine(
"</ul>");
1455 this.AppendHtml(
"<li");
1459 if (!(Detail is
null))
1464 this.AppendHtml(
" class=\"active\"");
1474 this.AppendHtml(
" class=\"active\"");
1479 this.AppendHtml(
">");
1481 this.AppendHtmlLine(
"</li>");
string ShortName
Emoji short name.
string Unicode
Unicode representation of emoji.
Helps with common JSON-related tasks.
static string Encode(string s)
Encodes a string for inclusion in JSON.
Renders JavaScript from a Markdown document.
async Task RenderObject(object Result, bool AloneInParagraph, Variables Variables)
Generates HTML from Script output.
override async Task Render(Delete Element)
Renders Element .
override async Task Render(TaskItem Element)
Renders Element .
override async Task Render(NumberedItem Element)
Renders Element .
override Task RenderDocumentHeader()
Renders the document header.
override async Task Render(BlockQuote Element)
Renders Element .
override Task Render(Link Element)
Renders Element .
override async Task Render(NumberedList Element)
Renders Element .
override async Task Render(Paragraph Element)
Renders Element .
override async Task Render(BulletList Element)
Renders Element .
override Task Render(DetailsReference Element)
Renders Element .
override async Task Render(MarginAligned Element)
Renders Element .
override Task RenderDocumentFooter()
Renders the document header.
override async Task Render(DeleteBlocks Element)
Renders Element .
override async Task Render(StrikeThrough Element)
Renders Element .
override async Task Render(HtmlBlock Element)
Renders Element .
override Task Render(InlineText Element)
Renders Element .
override async Task Render(SuperScript Element)
Renders Element .
override async Task Render(Table Element)
Renders Element .
override Task Render(HashTag Element)
Renders Element .
override async Task Render(Header Element)
Renders Element .
override async Task Render(TaskList Element)
Renders Element .
override async Task Render(DefinitionDescriptions Element)
Renders Element .
JavaScriptRenderer(HtmlSettings HtmlSettings, MarkdownDocument Document)
Renders JavaScript from a Markdown document.
override async Task Render(LeftAligned Element)
Renders Element .
override async Task Render(Abbreviation Element)
Renders Element .
override async Task RenderFootnotes()
Renders footnotes.
override async Task Render(Multimedia Element)
Renders Element .
override async Task Render(InsertBlocks Element)
Renders Element .
override async Task Render(Insert Element)
Renders Element .
override async Task Render(SubScript Element)
Renders Element .
override Task Render(InlineScript Element)
Renders Element .
override async Task Render(DefinitionTerms Element)
Renders Element .
override Task Render(CommentBlock Element)
Renders Element .
JavaScriptRenderer(StringBuilder Output, HtmlSettings HtmlSettings, MarkdownDocument Document)
Renders JavaScript from a Markdown document.
override Task Render(MetaReference Element)
Renders Element .
override async Task Render(Underline Element)
Renders Element .
override Task Render(LinkReference Element)
Renders Element .
override Task Render(SectionSeparator Element)
Renders Element .
override async Task Render(Strong Element)
Renders Element .
JavaScriptRenderer(HtmlSettings HtmlSettings)
Renders JavaScript from a Markdown document.
override async Task Render(UnnumberedItem Element)
Renders Element .
override Task Render(Footnote Element)
Renders Element .
override Task Render(InlineCode Element)
Renders Element .
override Task Render(NestedBlock Element)
Renders Element .
override async Task Render(Emphasize Element)
Renders Element .
override Task Render(HtmlEntity Element)
Renders Element .
override Task Render(LineBreak Element)
Renders Element .
JavaScriptRenderer(StringBuilder Output, HtmlSettings HtmlSettings)
Renders JavaScript from a Markdown document.
async Task Render(string Url, string Title, IEnumerable< MarkdownElement > ChildNodes, MarkdownDocument Document)
Generates HTML for a link.
override Task Render(HtmlEntityUnicode Element)
Renders Element .
readonly HtmlSettings htmlSettings
HTML settings.
override Task Render(InvisibleBreak Element)
Renders Element .
override Task Render(HorizontalRule Element)
Renders Element .
override Task Render(EmojiReference Element)
Renders Element .
override async Task Render(CodeBlock Element)
Renders Element .
override Task Render(InlineHTML Element)
Renders Element .
override async Task Render(Sections Element)
Renders Element .
override async Task Render(MultimediaReference Element)
Renders Element .
override async Task Render(CenterAligned Element)
Renders Element .
override Task Render(AutomaticLinkUrl Element)
Renders Element .
override async Task Render(RightAligned Element)
Renders Element .
override async Task Render(FootnoteReference Element)
Renders Element .
override Task Render(AutomaticLinkMail Element)
Renders Element .
override async Task Render(DefinitionList Element)
Renders Element .
Class that can be used to encapsulate Markdown to be returned from a Web Service, bypassing any encod...
Contains a markdown document. This markdown document class supports original markdown,...
static async Task< object > TransformXml(XmlDocument Xml, Variables Variables)
Transforms XML to an object that is easier to visualize.
bool IncludesTableOfContents
If the document contains a Table of Contents.
string CheckURL(string Url, string URL)
Checks the URL if it needs redirection to a proxy.
IEnumerable< MarkdownElement > Elements
Markdown elements making up the document.
IEnumerable< string > FootnoteOrder
Order of footnotes.
IEmojiSource EmojiSource
Source for emojis in the document.
string ResourceName
Local resource name of Markdown document, if referenced through a web server. Master documents use th...
string FileName
Filename of Markdown document. Markdown inclusion will be made relative to this filename.
MarkdownDocument Detail
Detail document of a master document.
Multimedia GetReference(string Label)
Gets the multimedia information referenced by a label.
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.
Represents a block quote in a markdown document.
Represents a bullet list in a markdown document.
Represents a center-aligned set of blocks in a markdown document.
Represents a code block in a markdown document.
string IndentString
String used for indentation.
int Indent
Code block indentation.
string[] Rows
Rows in code block
Represents a definition list in a markdown document.
Represents inserted blocks in a markdown document.
Represents a block of HTML in a markdown document.
Represents inserted blocks in a markdown document.
Represents a left-aligned set of blocks in a markdown document.
Represents a margin-aligned set of blocks in a markdown document.
Represents a nested block with no special formatting rules in a markdown document.
override Task Render(IRenderer Output)
Renders the element.
Represents a numbered item in an ordered list.
bool NumberExplicit
If number is explicitly provided (true) or inferred (false).
int Number
Number associated with item.
Represents a numbered list in a markdown document.
Represents a paragraph in a markdown document.
bool Implicit
If paragraph is implicit or not.
Represents a right-aligned set of blocks in a markdown document.
int NrColumns
Number of columns in following section.
Represents a sequence of sections.
int InitialNrColumns
Number of columns for initial section.
Represents a table in a markdown document.
TextAlignment[] ColumnAlignments
Table column alignments.
string Caption
Table caption.
MarkdownElement[][] Headers
Headers in table.
int Columns
Number of columns.
TextAlignment?[][] RowCellAlignments
Row cell alignments in table.
TextAlignment?[][] HeaderCellAlignments
Header cell alignments in table.
MarkdownElement[][] Rows
Rows in table.
Represents a task item in a task list.
int CheckPosition
Position of the checkmark in the original markdown text document.
bool IsChecked
If the item is checked or not.
Represents a task list in a markdown document.
Represents an unnumbered item in an ordered list.
override IEnumerable< MarkdownElement > Children
Any children of the element.
MarkdownElement LastChild
Last child, or null if none.
void AddChildren(params MarkdownElement[] NewChildren)
Adds children to the element.
Abstract base class for all markdown elements.
abstract Task Render(IRenderer Output)
Renders the element.
virtual IEnumerable< MarkdownElement > Children
Any children of the element.
abstract bool InlineSpanElement
If the element is an inline span element.
MarkdownDocument Document
Markdown document.
MarkdownElement Child
Child element.
string Title
Optional title.
string Description
Description
string Delimiter
Delimiter string used to identify emoji.
int Level
Level (number of colons used to define the emoji)
EmojiInfo Emoji
Emoji information.
Represents an HTML entity.
Represents an HTML entity in Unicode format.
int Code
Unicode character
Expression Expression
Expression
string Value
Unformatted text.
string Title
Optional Link title.
bool TryGetMetaData(out KeyValuePair< string, bool >[] Values)
Tries to get meta-data from the document.
MultimediaItem[] Items
Multimedia items.
bool AloneInParagraph
If the element is alone in a paragraph.
bool AloneInParagraph
If the element is alone in a paragraph.
Renders HTML from a Markdown document.
Contains settings that the HTML export uses to customize HTML output.
Abstract base class for Markdown renderers.
readonly StringBuilder Output
Renderer output.
Task RenderChild(MarkdownElementSingleChild Element)
Renders the child of Element .
async Task RenderChildren(MarkdownElementChildren Element)
Renders the children of Element .
virtual async Task RenderDocument(MarkdownDocument Document, bool Inclusion)
Renders a document.
override string ToString()
Returns the renderer output.
MarkdownDocument Document
Reference to Markdown document being processed.
Helps with common XML-related tasks.
static string HtmlValueEncode(string s)
Differs from Encode(String), in that it does not encode the aposotrophe or the quote.
static string Encode(string s)
Encodes a string for use in XML.
static string HtmlAttributeEncode(string s)
Differs from Encode(String), in that it does not encode the aposotrophe.
Static class managing the application event log. Applications and services log events on this static ...
static Exception UnnestException(Exception Exception)
Unnests an exception, to extract the relevant inner exception.
Class managing a script expression.
string Script
Original script string.
static string ToString(double Value)
Converts a value to a string, that can be parsed as part of an expression.
Handles two-dimensional graphs.
string Title
Title for graph.
int Width
Width of graph, in pixels. (Default=640 pixels.)
int Height
Height of graph, in pixels. (Default=480 pixels.)
ToMatrix(ScriptNode Operand, bool NullCheck, int Start, int Length, Expression Expression)
To-Matrix operator.
Interface for Emoji sources. Emoji sources provide emojis to content providers.
Task GenerateHTML(StringBuilder Output, EmojiInfo Emoji, bool EmbedImage)
Generates HTML for a given Emoji.
bool EmojiSupported(EmojiInfo Emoji)
If the emoji is supported by the emoji source.
Interface for code content HTML renderers.
Interface for multimedia content HTML renderers.
Interface for objects that can be converted into matrices.
TextAlignment
Text alignment of contents.