示例#1
0
 public LogHandler(ILogWriter logWriter,
                   ILogEnvironmentHandler logEnvironmentHandler,
                   ISourceHandler sourceHandler)
 {
     _logWriter             = logWriter;
     _logEnvironmentHandler = logEnvironmentHandler;
     _sourceHandler         = sourceHandler;
 }
示例#2
0
        public MarkdownContentParser(ISourceHandler sourceHandler)
        {
            this.sourceHandler = sourceHandler;

            this.pipeline = new MarkdownPipelineBuilder()
                            .UseYamlFrontMatter()
                            .UseAdvancedExtensions()
                            .Build();
        }
示例#3
0
        public Context(ISourceHandler sourceHandler, IFrontMatterDeserializer frontMatterDeserializer)
        {
            this.sourceHandler           = sourceHandler;
            this.frontMatterDeserializer = frontMatterDeserializer;

            this.InitializePosts();
            this.InitializeTags();
            this.InitializePages();
            this.ReferenceObjects();
        }
示例#4
0
        public FileSystemOutputHandler(
            CommandLineOptions commandLineOptions,
            IFileSystem fileSystem,
            IContext <Post, Tag, Page> context,
            ITemplateHandler templateHandler,
            IContentParser contentParser,
            IOptions <SiteConfig> siteConfig,
            ISourceHandler sourceHandler,
            ISlugHelper slugHelper)
        {
            (this.commandLineOptions, this.fileSystem, this.context, this.templateHandler,
             this.contentParser, this.siteConfig, this.sourceHandler, this.slugHelper) =
                (commandLineOptions, fileSystem, context, templateHandler, contentParser, siteConfig.Value, sourceHandler, slugHelper);

            this.site = new { config = this.siteConfig, tags = this.context.Tags.OrderBy(t => t.Name), pages = this.context.Pages };
        }
示例#5
0
        public HandlebarsTemplateHandler(
            ISourceHandler sourceHandler,
            IHandlebars handlebars,
            IOptions <SiteConfig> siteConfig)
        {
            this.handlebars = handlebars;

            this.siteConfig = siteConfig.Value;

            using var sr = new StreamReader(sourceHandler.GetTemplate());

            this.RegisterHelpers();

            this.renderTemplate = this.handlebars.Compile(sr);

            this.RegisterPartials(sourceHandler.GetPartials());

            this.RegisterLayouts(sourceHandler.GetLayouts());
        }