-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathMarkdownToJavaScriptConverter.cs
More file actions
49 lines (44 loc) · 1.08 KB
/
MarkdownToJavaScriptConverter.cs
File metadata and controls
49 lines (44 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Threading.Tasks;
using Waher.Runtime.Inventory;
using Waher.Content.Markdown.JavaScript;
namespace Waher.Content.Markdown.Web
{
/// <summary>
/// Converts Markdown documents to JavaScript documents.
/// </summary>
public class MarkdownToJavaScriptConverter : MarkdownToHtmlConverter
{
/// <summary>
/// Converts Markdown documents to JavaScript documents.
/// </summary>
public MarkdownToJavaScriptConverter()
{
}
/// <summary>
/// Converts content to these content types.
/// </summary>
public override string[] ToContentTypes
{
get
{
return new string[]
{
"application/javascript"
};
}
}
/// <summary>
/// How well the content is converted.
/// </summary>
public override Grade ConversionGrade => Grade.Ok;
/// <summary>
/// Performs the actual conversion
/// </summary>
/// <param name="Doc">Markdown document prepared for conversion.</param>
/// <returns>Conversion result.</returns>
protected override Task<string> DoConversion(MarkdownDocument Doc)
{
return Doc.GenerateJavaScript();
}
}
}