private static DocSet GetDocSet(Options options, IssueLogger issues) { Logger.Info("Opening documentation from {0}", options.DocsRoot); DocSet docSet = null; try { docSet = new DocSet(options.DocsRoot + "\\api-reference\\v1.0\\"); } catch (System.IO.FileNotFoundException ex) { Logger.Error(ex.Message); return(null); } Logger.Info("Parsing documentation files"); var stopwatch = new Stopwatch(); stopwatch.Start(); docSet.ScanDocumentation(string.Empty, issues); stopwatch.Stop(); Logger.Info($"Took {stopwatch.Elapsed} to parse {docSet.Files.Length} source files."); return(docSet); }
public void EnsureDocSet() { if (docs == null) { docs = new DocSet(this.pathToDocs); docs.ScanDocumentation(String.Empty, issues); } }
/// <summary> /// Create and return a document set based on input options /// </summary> /// <param name="options"></param> /// <returns></returns> private static async Task <DocSet> GetDocSetAsync(DocSetOptions options) { FancyConsole.VerboseWriteLine("Opening documentation from {0}", options.DocumentationSetPath); DocSet set = new DocSet(options.DocumentationSetPath); FancyConsole.VerboseWriteLine("Scanning documentation files..."); ValidationError[] loadErrors; if (!set.ScanDocumentation(out loadErrors)) { await WriteOutErrorsAndFinishTestAsync(loadErrors, options.SilenceWarnings); return(null); } return(set); }
private static DocSet GetDocSet(Options options, IssueLogger issues) { Logger.Info("Opening documentation from {0}", options.DocsRoot); DocSet docSet = null; try { docSet = new DocSet(options.DocsRoot); } catch (FileNotFoundException ex) { Logger.Error(ex.Message); return(null); } Logger.Info("Parsing documentation files"); var stopwatch = new Stopwatch(); stopwatch.Start(); docSet.ScanDocumentation(string.Empty, issues); // Json transformation for empty base types should default to null // but they default to empty string. Clean those up here. foreach (var resource in docSet.Resources) { if (resource.BaseType == string.Empty) { resource.BaseType = null; } } stopwatch.Stop(); Logger.Info($"Took {stopwatch.Elapsed} to parse {docSet.Files.Length} source files."); return(docSet); }