Example #1
0
        protected override void ProcessRecord()
        {
            if (ParameterSetName == "FromPath")
            {
                if (helper == null)
                {
                    helper = Site.ForPath(GetPluginPath(Path));
                }

                ProviderInfo providerInfo;
                var          files = GetResolvedProviderPathFromPSPath(Path, out providerInfo);
                foreach (var file in files)
                {
                    Markup = new NamedContentBase(file, preloadContent: true);
                    WriteObject(helper[Markup.Extension].Render(SiteRootPath, Markup.RawContent, Data));
                }
            }
            else
            {
                if (helper == null)
                {
                    helper = Site.ForPath(GetPluginPath(Markup.SourcePath));
                }

                Markup.RenderedContent = helper[Markup.Extension].Render(SiteRootPath, Markup.RawContent, Data);
                WriteObject(Markup);
            }
        }
Example #2
0
 protected void Render(NamedContentBase layout, dynamic model, string outputPath)
 {
     Utility.CreateDirectoryIfNecessary(Path.GetDirectoryName(outputPath));
     File.WriteAllText(outputPath, Render(layout, model));
 }
Example #3
0
 public string Render(NamedContentBase layout, dynamic model)
 {
     return(_renderEngines[layout.Extension].Render(SiteRootPath, layout.RawContent, model));
 }
Example #4
0
 public void Render(NamedContentBase doc)
 {
     doc.RenderedContent = Render(doc, doc);
 }