Ejemplo n.º 1
0
        private void CreateReport(string markdownPath)
        {
            Console.WriteLine("Creating report...");
            string text = DragonUtil.QuickReadFile(markdownPath);

            string report   = ContentScanner.ParseScanrResults(ContentScanner.ScanMarkdown(text, markdownPath));
            string savePath = Path.GetDirectoryName(markdownPath) + Path.GetFileNameWithoutExtension(markdownPath) +
                              "_REPORT.txt";

            DragonUtil.QuickWriteFile(savePath, report);
            Console.WriteLine("Saved report to " + savePath);
        }
Ejemplo n.º 2
0
        public static MarkdownAndHtml ReplaceLocalImageLinksWithUrls(string markdownPath, string markdownText, string htmlPath, string htmlText, bool onlyUpdateHtml, List <string> localImagePaths, List <string> imageUrls)
        {
            markdownText = DragonUtil.BatchReplaceText(markdownText, localImagePaths, imageUrls);
            htmlText     = DragonUtil.BatchReplaceText(htmlText, localImagePaths, imageUrls);
            //var htmlText = ConvertMarkdownStringToHtml(markdownText,);

            if (htmlPath != null)
            {
                DragonUtil.QuickWriteFile(htmlPath, htmlText);
                Console.WriteLine("Replaced HTML!");
            }

            if (!onlyUpdateHtml)
            {
                DragonUtil.QuickWriteFile(markdownPath, markdownText);
                Console.WriteLine("Replaced Markdown!");
            }

            return(new MarkdownAndHtml {
                Markdown = markdownText, Html = htmlText
            });
        }