Пример #1
0
 public PrintBuilder(RuntimeSettings settings, ILog log, ShortCodeLoader loader, CsharpScriptHandler scriptHandler)
     : base(settings, log, loader, scriptHandler)
 {
     AddStep(new GeneratorSteps.CreateOutputDirectory());
     AddStep(new GeneratorSteps.CopyAssets(settings.Configuration.TargetPrint));
     AddStep(new GeneratorSteps.ImageProcessor());
     AddStep(new GeneratorSteps.CreatePrintableHtml());
 }
Пример #2
0
        public WordpressBuilder(RuntimeSettings settings, ILog log, ShortCodeLoader loader, CsharpScriptHandler scriptHandler)
            : base(settings, log, loader, scriptHandler)
        {
            var session = new GeneratorSteps.Wordpress.Session();

            AddStep(new GeneratorSteps.CreateOutputDirectory());
            AddStep(new GeneratorSteps.ImageProcessor());
            AddStep(new GeneratorSteps.Wordpress.CreateWpChannel(session));
            AddStep(new GeneratorSteps.Wordpress.CreateWpPages(session));
            AddStep(new GeneratorSteps.Wordpress.WriteExportXmlFile(session));
        }
Пример #3
0
        public EpubBuilder(RuntimeSettings settings, ILog log, ShortCodeLoader loader, CsharpScriptHandler scriptHandler)
            : base(settings, log, loader, scriptHandler)
        {
            var session = new GeneratorSteps.Epub.EpubSession();

            AddStep(new GeneratorSteps.CreateOutputDirectory());
            AddStep(new GeneratorSteps.CopyAssets(settings.Configuration.TargetEpub));
            AddStep(new GeneratorSteps.ImageProcessor());
            AddStep(new GeneratorSteps.Epub.CreateEpubStructure());
            AddStep(new GeneratorSteps.Epub.CreateEpubPages(session));
            AddStep(new GeneratorSteps.Epub.CreateEpubToc());
            AddStep(new GeneratorSteps.Epub.CreatePackageOpf(session));
            AddStep(new GeneratorSteps.Epub.CreateEpubPack());
        }
Пример #4
0
 public WebsiteBuilder(RuntimeSettings settings, ILog log, ShortCodeLoader loader, CsharpScriptHandler scriptHandler)
     : base(settings, log, loader, scriptHandler)
 {
     AddStep(new GeneratorSteps.CreateOutputDirectory());
     AddStep(CreateAssets());
     AddStep(new GeneratorSteps.CopyAssets(settings.Configuration.TargetWeb));
     AddStep(new GeneratorSteps.ImageProcessor());
     AddStep(new GeneratorSteps.CreateToCForWebsite());
     AddStep(new GeneratorSteps.CreatePagesJS());
     AddStep(new GeneratorSteps.CreateMetadata());
     AddStep(new GeneratorSteps.CreateIndexHtml());
     AddStep(new GeneratorSteps.CreatePages());
     AddStep(new GeneratorSteps.CreateSubpageIndexes());
     AddStep(new GeneratorSteps.GenerateSearchPage());
     AddStep(new GeneratorSteps.CreateSitemap());
 }
Пример #5
0
        public void DoTest()
        {
            if (_configuration == null)
            {
                throw new InvalidOperationException("Configuration is null");
            }

            if (_toc == null)
            {
                throw new InvalidOperationException("Table of contents is null");
            }

            Log.Info("Building test configuration...");
            _configuration.HostName = "http://localhost:8080/";

            var settings = _projectLoader.CreateRuntimeSettings(_configuration, _toc, _configuration.TargetWeb);


            using (var loader = new ShortCodeLoader(Log, settings, Program.AppSetting))
            {
                WebsiteBuilder builder = new WebsiteBuilder(settings, Log, loader, _scriptHandler);
                var            runTime = builder.Run();

                using (var server = HttpServerFactory.CreateServerForTest(ServerLog, Path.Combine(WorkDirectory, _configuration.TargetWeb.OutPutDirectory)))
                {
                    server.Start();
                    Log.Info("-------------------------------------------------");
                    Log.Info("Runtime: {0:0.000} ms", runTime.TotalMilliseconds);
                    Log.Info("Test server running on: http://localhost:8080/");
                    Log.Info("Serving from: {0}", _configuration.TargetWeb.OutPutDirectory);

                    if (Program.AppSetting.AutoStartWebserver)
                    {
                        StartUrl(_configuration.HostName);
                    }

                    Console.WriteLine(ExitString);
                    Console.ReadLine();
                    server.Stop();
                }
            }
        }
Пример #6
0
        public void DoWordpress()
        {
            if (_configuration == null)
            {
                throw new InvalidOperationException("Configuration is null");
            }

            if (_toc == null)
            {
                throw new InvalidOperationException("Table of contents is null");
            }

            var settings = _projectLoader.CreateRuntimeSettings(_configuration, _toc, _configuration.TargetWordpress);

            Log.Info("Building Wordpress configuration...");

            using (var loader = new ShortCodeLoader(Log, settings, Program.AppSetting))
            {
                WordpressBuilder builder = new WordpressBuilder(settings, Log, loader, _scriptHandler);
                var runTime = builder.Run();
                Log.Info("Runtime: {0:0.000} ms", runTime.TotalMilliseconds);
            }
        }