Exemplo n.º 1
0
        public static Task <string> ToHtml(string markdown, string templatePath)
        {
            var outputContent = MoonShine.Markdownify(
                markdown,
                Extensions,
                true);

            if (string.IsNullOrWhiteSpace(outputContent))
            {
                outputContent = "<body></body>";
            }

            outputContent = RemoveCodeSnippetExtraBreakline(outputContent);
            outputContent = PrcessCodeSnippetHeaders(outputContent);
            outputContent = new CodeSnippetHighlighter(outputContent).Highlight();

            var props = new Dictionary <string, object> {
                { "Content", outputContent }
            };

            return(Task.FromResult(TextTemplatingHelper.Process(templatePath, props)));
        }