public static void ExecutePipeline(MetadataModel yaml, ResolverContext context) { foreach (var pipeline in pipelines) { pipeline.Run(yaml, context); } }
/// <summary> /// TODO: input Namespace list instead; /// TODO: Save to ...yml.map /// </summary> /// <param name="allMembers"></param> /// <returns></returns> public static MetadataModel ResolveMetadata( Dictionary<string, MetadataItem> allMembers, Dictionary<string, ReferenceItem> allReferences, string apiFolder, bool preserveRawInlineComments, IEnumerable<string> externalReferencePackages) { MetadataModel viewModel = new MetadataModel(); viewModel.TocYamlViewModel = new MetadataItem() { Type = MemberType.Toc, Items = allMembers.Where(s => s.Value.Type == MemberType.Namespace).Select(s => s.Value).ToList(), }; viewModel.Members = new List<MetadataItem>(); ResolverContext context = new ResolverContext { ApiFolder = apiFolder, References = allReferences, PreserveRawInlineComments = preserveRawInlineComments, }; ExecutePipeline(viewModel, context); return viewModel; }
/// <summary> /// TODO: input Namespace list instead; /// TODO: Save to ...yml.map /// </summary> /// <param name="allMembers"></param> /// <returns></returns> public static MetadataModel ResolveMetadata( Dictionary <string, MetadataItem> allMembers, Dictionary <string, ReferenceItem> allReferences, string apiFolder, bool preserveRawInlineComments, IEnumerable <string> externalReferencePackages) { MetadataModel viewModel = new MetadataModel(); viewModel.TocYamlViewModel = new MetadataItem() { Type = MemberType.Toc, Items = allMembers.Where(s => s.Value.Type == MemberType.Namespace).Select(s => s.Value).ToList(), }; viewModel.Members = new List <MetadataItem>(); ResolverContext context = new ResolverContext { ApiFolder = apiFolder, References = allReferences, PreserveRawInlineComments = preserveRawInlineComments, }; ExecutePipeline(viewModel, context); return(viewModel); }
public void Run(MetadataModel yaml, ResolverContext context) { if (yaml.Members != null && yaml.Members.Count > 0) { UpdateDerivedClassMapping(yaml.Members, context.References); AppendDerivedClass(yaml.Members); } }
public void Run(MetadataModel yaml, ResolverContext context) { TreeIterator.Preorder(yaml.TocYamlViewModel, null, s => s.IsInvalid ? null : s.Items, (current, parent) => { current.Parent = parent; return(true); }); }
public void Run(MetadataModel yaml, ResolverContext context) { TreeIterator.Preorder(yaml.TocYamlViewModel, null, s => s.IsInvalid ? null : s.Items, (current, parent) => { current.Parent = parent; return true; }); }
public void Run(MetadataModel yaml, ResolverContext context) { TreeIterator.Preorder( yaml.TocYamlViewModel, null, s => s.IsInvalid ? null : s.Items, (current, parent) => { if (current.InheritDoc != null) { InheritDoc(current, context); current.InheritDoc = null; } return(true); }); }
/// <summary> /// The yaml layout should be /// namespace -- class level -- method level /// </summary> /// <param name="allMembers"></param> /// <returns></returns> public void Run(MetadataModel yaml, ResolverContext context) { StringBuilder message = new StringBuilder(); foreach (var member in yaml.TocYamlViewModel.Items) { var result = CheckNamespaces(member); if (!string.IsNullOrEmpty(result)) { message.AppendLine(result); } } if (message.Length > 0) { Logger.LogWarning(message.ToString()); } }
public void Run(MetadataModel yaml, ResolverContext context) { TreeIterator.Preorder(yaml.TocYamlViewModel, null, s => { if (s.IsInvalid || (s.Type != MemberType.Namespace && s.Type != MemberType.Toc)) return null; else return s.Items; }, (member, parent) => { if (member.Type != MemberType.Toc) { yaml.Members.Add(member); } return true; }); }
public void Run(MetadataModel yaml, ResolverContext context) { TreeIterator.Preorder(yaml.TocYamlViewModel, null, s => s.IsInvalid ? null : s.Items, (current, parent) => { MetadataItem page; var addingReferences = new List<ReferenceItem>(); var documentReferences = current.References; if (current.Type.IsPageLevel()) { page = current; current.References = new Dictionary<string, ReferenceItem>(); } else { page = parent; current.References = null; } if (documentReferences != null && documentReferences.Count > 0) { foreach (var key in documentReferences.Keys) { TryAddReference(context, page, addingReferences, key); } } foreach (var key in GetReferenceKeys(current)) { TryAddReference(context, page, addingReferences, key); } if (current.Type == MemberType.Namespace) { foreach (var item in current.Items) { TryAddReference(context, page, addingReferences, item.Name); } } AddIndirectReference(context, page, addingReferences); return true; }); }
public void Run(MetadataModel yaml, ResolverContext context) { TreeIterator.Preorder(yaml.TocYamlViewModel, null, s => s.IsInvalid ? null : s.Items, (current, parent) => { MetadataItem page; var addingReferences = new List <ReferenceItem>(); var documentReferences = current.References; if (current.Type.IsPageLevel()) { page = current; current.References = new Dictionary <string, ReferenceItem>(); } else { page = parent; current.References = null; } if (documentReferences != null && documentReferences.Count > 0) { foreach (var key in documentReferences.Keys) { TryAddReference(context, page, addingReferences, key); } } foreach (var key in GetReferenceKeys(current)) { TryAddReference(context, page, addingReferences, key); } if (current.Type == MemberType.Namespace) { foreach (var item in current.Items) { TryAddReference(context, page, addingReferences, item.Name); } } AddIndirectReference(context, page, addingReferences); return(true); }); }
public void Run(MetadataModel yaml, ResolverContext context) { TreeIterator.Preorder( yaml.TocYamlViewModel, null, s => s.IsInvalid ? null : s.Items, (member, parent) => { // get all the possible places where link is possible if (member.Syntax != null && member.Syntax.Content != null) { SyntaxLanguage[] keys = new SyntaxLanguage[member.Syntax.Content.Count]; member.Syntax.Content.Keys.CopyTo(keys, 0); foreach (var key in keys) { member.Syntax.Content[key] = NormalizeLines(member.Syntax.Content[key]); } } return(true); }); }
public void Run(MetadataModel yaml, ResolverContext context) { TreeIterator.Preorder( yaml.TocYamlViewModel, null, s => s.IsInvalid ? null : s.Items, (member, parent) => { // get all the possible places where link is possible if (member.Syntax != null && member.Syntax.Content != null) { SyntaxLanguage[] keys = new SyntaxLanguage[member.Syntax.Content.Count]; member.Syntax.Content.Keys.CopyTo(keys, 0); foreach(var key in keys) { member.Syntax.Content[key] = NormalizeLines(member.Syntax.Content[key]); } } return true; }); }
public void Run(MetadataModel yaml, ResolverContext context) { TreeIterator.Preorder(yaml.TocYamlViewModel, null, s => { if (s.IsInvalid || (s.Type != MemberType.Namespace && s.Type != MemberType.Toc)) { return(null); } else { return(s.Items); } }, (member, parent) => { if (member.Type != MemberType.Toc) { yaml.Members.Add(member); } return(true); }); }