Example #1
0
 private void BuildDocument(FileCollection files, Dictionary<string, object> metadata = null, ApplyTemplateSettings applyTemplateSettings = null, string templateFolder = null)
 {
     using (var builder = new DocumentBuilder(LoadAssemblies(), ImmutableArray<string>.Empty, null, templateFolder))
     {
         if (applyTemplateSettings == null)
         {
             applyTemplateSettings = new ApplyTemplateSettings(_inputFolder, _outputFolder);
             applyTemplateSettings.RawModelExportSettings.Export = true;
         }
         var parameters = new DocumentBuildParameters
         {
             Files = files,
             OutputBaseDir = Path.Combine(Directory.GetCurrentDirectory(), _outputFolder),
             ApplyTemplateSettings = applyTemplateSettings,
             Metadata = metadata?.ToImmutableDictionary(),
             TemplateManager = new TemplateManager(null, null, new List<string> { _templateFolder }, null, null),
             TemplateDir = templateFolder,
         };
         builder.Build(parameters);
     }
 }
Example #2
0
 private void BuildDocument(
     FileCollection files,
     string inputFolder,
     string outputFolder,
     Dictionary<string, object> metadata = null,
     ApplyTemplateSettings applyTemplateSettings = null,
     string templateFolder = null,
     string intermediateFolder = null,
     Dictionary<string, ChangeKindWithDependency> changes = null)
 {
     using (var builder = new DocumentBuilder(LoadAssemblies(), ImmutableArray<string>.Empty, null, intermediateFolder))
     {
         if (applyTemplateSettings == null)
         {
             applyTemplateSettings = new ApplyTemplateSettings(inputFolder, outputFolder);
         }
         var parameters = new DocumentBuildParameters
         {
             Files = files,
             OutputBaseDir = Path.Combine(Directory.GetCurrentDirectory(), outputFolder),
             ApplyTemplateSettings = applyTemplateSettings,
             Metadata = metadata?.ToImmutableDictionary(),
             TemplateManager = new TemplateManager(null, null, new List<string> { templateFolder }, null, null),
             TemplateDir = templateFolder,
             Changes = changes?.ToImmutableDictionary(),
         };
         builder.Build(parameters);
     }
 }