public static DocumentationParserFactory GetFactory() { var f = new DocumentationParserFactory(); f.AddParser(ParserKeys.Bootstrap, typeof(Blazorade.Bootstrap.Components._Imports).Assembly); f.AddParser(ParserKeys.Core, typeof(Blazorade.Core._Imports).Assembly); f.AddParser(ParserKeys.XmlDocs, typeof(Blazorade.XmlDocumentation.DocumentationParser).Assembly); f.AddParser(ParserKeys.XmlDocsComponenents, typeof(Blazorade.XmlDocumentation.Components._Imports).Assembly); f.AddParser(ParserKeys.TestLib, typeof(TestLibrary.SomeNamespace.Class1).Assembly); return(f); }
public void AddParser01() { var t = typeof(Alert); DocumentationParserFactory f = new DocumentationParserFactory(); var p = f.AddParser(ParserKeys.Bootstrap, t.Assembly); var doc = p.GetDocumentation(t); Assert.IsNotNull(doc); Assert.AreEqual(t, doc.Member); }
public void ReadAssemblyInfo01() { var f = new DocumentationParserFactory(); f.AddParser(ParserKeys.Bootstrap, typeof(BootstrapComponentBase).Assembly); var p = f.GetParser(ParserKeys.Bootstrap); Assert.IsNotNull(p.AssemblyName); Assert.IsNotNull(p.AssemblyVersion); Assert.IsNotNull(p.AssemblyProductName); Assert.IsNotNull(p.AssemblyDescription); }
public static IServiceCollection AddBlazoradeXmlDocumentation(this IServiceCollection services, Action <XmlDocumentationOptions> configureOptions) { var options = new XmlDocumentationOptions(); configureOptions?.Invoke(options); var factory = new DocumentationParserFactory(); foreach (var key in options?.Parsers?.Keys ?? new string[0]) { factory.AddParser(key, options.Parsers[key]); } services.AddSingleton(factory); services.AddSingleton <DocumentationUriBuilder>(options.UriBuilder ?? new DocumentationUriBuilder()); return(services); }