public TemplateManager(Assembly assembly, string rootNamespace, List <string> templates, List <string> themes, string baseDirectory) { var resourceFinder = new ResourceFinder(assembly, rootNamespace, baseDirectory); if (templates == null || templates.Count == 0) { Logger.Log(LogLevel.Info, "Template is not specified, files will not be transformed."); } else { var templateResources = templates.Select(s => resourceFinder.Find(s)).Where(s => s != null).ToArray(); if (templateResources.Length == 0) { Logger.Log(LogLevel.Warning, $"No template resource found for [{templates.ToDelimitedString()}]."); } else { _templateProcessor = new TemplateProcessor(new CompositeResourceCollectionWithOverridden(templateResources)); } } if (themes == null || themes.Count == 0) { Logger.Log(LogLevel.Info, "Theme is not specified, no additional theme will be applied to the documentation."); } else { var themeResources = themes.Select(s => resourceFinder.Find(s)).Where(s => s != null).ToArray(); if (themeResources.Length == 0) { Logger.Log(LogLevel.Warning, $"No theme resource found for [{themes.ToDelimitedString()}]."); } else { _themeResource = new CompositeResourceCollectionWithOverridden(themeResources); } } }
public TemplateManager(Assembly assembly, string rootNamespace, List<string> templates, List<string> themes, string baseDirectory) { var resourceFinder = new ResourceFinder(assembly, rootNamespace, baseDirectory); if (templates == null || templates.Count == 0) { Logger.Log(LogLevel.Info, "Template is not specified, files will not be transformed."); } else { var templateResources = templates.Select(s => resourceFinder.Find(s)).Where(s => s != null).ToArray(); if (templateResources.Length == 0) { Logger.Log(LogLevel.Warning, $"No template resource found for [{templates.ToDelimitedString()}]."); } else { _templateProcessor = new TemplateProcessor(new CompositeResourceCollectionWithOverridden(templateResources)); } } if (themes == null || themes.Count == 0) { Logger.Log(LogLevel.Info, "Theme is not specified, no additional theme will be applied to the documentation."); } else { var themeResources = themes.Select(s => resourceFinder.Find(s)).Where(s => s != null).ToArray(); if (themeResources.Length == 0) { Logger.Log(LogLevel.Warning, $"No theme resource found for [{themes.ToDelimitedString()}]."); } else { _themeResource = new CompositeResourceCollectionWithOverridden(themeResources); } } }
/// <summary> /// Template can contain a set of plugins to define the behavior of how to generate the output YAML data model /// The name of plugin folder is always "plugins" /// </summary> public IEnumerable <KeyValuePair <string, Stream> > GetTemplatePlugins() { using (var templateResource = new CompositeResourceCollectionWithOverridden(_templates.Select(s => _finder.Find(s)).Where(s => s != null))) { if (templateResource.IsEmpty) { yield break; } else { foreach (var pair in templateResource.GetResourceStreams(@"^plugins/.*")) { yield return(pair); } } } }
public TemplateProcessor GetTemplateProcessor() { return(new TemplateProcessor(new CompositeResourceCollectionWithOverridden(_templates.Select(s => _finder.Find(s)).Where(s => s != null)))); }