Exemplo n.º 1
0
        public void ConvertAndUpload(ConvertAndUploadArguments args)
        {
            string htmlPath = ConvertToHtml(args.MarkdownPath, args.HtmlPath, new ConverterOptions(args.FirstImageRightAligned, args.ConvertImageWithAltToCaption));

            Console.WriteLine("Starting image upload...");

            if (UploadImages(args.MarkdownPath, htmlPath, args.OnlyUpdateHtmlFile, args.Username, args.Password))
            {
                Console.WriteLine("Uploaded all images succesfully! The links were also replaced. Enjoy!");
            }
            else
            {
                ColoredConsole.WriteLineWithColor("ERROR: Something went wrong while uploading.", ConsoleColor.Red);
            }

            CoreConsoleShared.PauseAndQuit();
        }
        private static void ConversionFinished(string generatedHtmlPath)
        {
            Console.WriteLine("------------");
            Console.WriteLine("All tasks completed! Thanks for using this app! :]");

            string openHtml = null;

            while (openHtml != "y" && openHtml != "n")
            {
                Console.WriteLine(
                    "Do you want to open the generated HTML file so you can copy its source to the WordPress post now? (y/n)");
                openHtml = Console.ReadLine();
            }

            if (openHtml == "y")
            {
                CoreConsoleShared.OpenHtmlResult(generatedHtmlPath);
            }

            CoreConsoleShared.PauseAndQuit();
        }
Exemplo n.º 3
0
 public void SimpleConvert(ConvertArguments args)
 {
     ConvertToHtml(args.MarkdownPath, args.HtmlPath, new ConverterOptions(args.FirstImageRightAligned, args.ConvertImageWithAltToCaption));
     CoreConsoleShared.PauseAndQuit();
 }