Example #1
0
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine($"Usage: {Path.GetFileName(Application.ExecutablePath)} <fileName> <[targetFileName]>");
                return;
            }
            var filename       = args[0];
            var targetFileName = args.Length >= 2 ? args[1] : filename + ".html";
            var p = new MarkdownProcessor();

            File.WriteAllText(targetFileName, WrapWithHtmlHeadAndBody(p.ProcessFromFile(filename)));
        }
Example #2
0
 static void Main(string[] args)
 {
     if (args.Length != 1)
     {
         Console.WriteLine("Usage: Markdown.exe [filename]");
         return;
     }
     if (File.Exists(args[0]))
     {
         var allText = File.ReadAllText(args[0]);
         var htmlFormatter = new HtmlFormatter();
         var processor = new MarkdownProcessor(allText, htmlFormatter);
         var html = processor.GetMarkdown();
         File.WriteAllText("result.html", html, Encoding.UTF8);
     }
     else
         Console.WriteLine("File not found.");
 }
Example #3
0
 public void TestInitialize()
 {
     _p = new MarkdownProcessor();
 }
Example #4
0
 public Converter(string text)
 {
     this.text   = text;
     mdPraser    = new MarkdownParser();
     mdProcessor = new MarkdownProcessor();
 }
Example #5
0
 public void TestInitialize()
 {
     _p = new MarkdownProcessor();
 }