-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathMarkdownToSmartContractConverter.cs
More file actions
49 lines (44 loc) · 1.13 KB
/
MarkdownToSmartContractConverter.cs
File metadata and controls
49 lines (44 loc) · 1.13 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 Waher.Runtime.Inventory;
using System.Threading.Tasks;
using Waher.Content.Markdown.Contracts;
namespace Waher.Content.Markdown.Web
{
/// <summary>
/// Converts Markdown documents to Neuro-Foundation Smart Contract XML documents.
/// </summary>
public class MarkdownToSmartContractConverter : MarkdownToHtmlConverter
{
/// <summary>
/// Converts Markdown documents to Neuro-Foundation Smart Contract XML documents.
/// </summary>
public MarkdownToSmartContractConverter()
{
}
/// <summary>
/// Converts content to these content types.
/// </summary>
public override string[] ToContentTypes
{
get
{
return new string[]
{
"application/xml+iotsc"
};
}
}
/// <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.GenerateSmartContractXml();
}
}
}