示例#1
0
    private void Convert(string path)
    {
        ConverterOptions options = GetConverterOptions();

        if (path != null)
        {
            if (File.Exists(path))
            {
                MarkdownPath = path;
                _htmlPath    = null;

                Markdown = File.ReadAllText(path).Replace("\t", "  ");
                ConvertMarkdownAndFillTextFields(Markdown, path);

                if (_useContentScanner)
                {
                    print(ContentScanner.ParseScanrResults(ContentScanner.ScanMarkdown(Markdown)));
                }

                if (_saveOutputToHtml)
                {
                    _htmlPath = DragonUtil.GetFullPathWithoutExtension(path) + ".html";
                    Converter.ConvertMarkdownFileToHtmlFile(path, _htmlPath, options);
                }

                UIManager.Instance.HideLoadingScreen();
                UIManager.Instance.SetStatusText("Converted markdown! Copy HTML on right side or start Image Linker (experimental).");
            }
        }
        else
        {
            UIManager.Instance.HideLoadingScreen();
            UIManager.Instance.SetStatusText("No valid markdown chosen!");
        }
    }
示例#2
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);
        }
示例#3
0
 public void ShowMarkdownAnalysis()
 {
     UIManager.Instance.HideMarkdownToHtmlCanvas();
     UIManager.Instance.ShowAnalysisCanvas(ContentScanner.ParseScanrResults(ContentScanner.ScanMarkdown(Markdown)));
 }