private void AddTableOfContentsSection(MarkdownSection parent, string header, List <DotNetDelegate> _delegates) { if (_delegates.Count == 0) { return; } MarkdownSection section = parent.AddSection(header); foreach (DotNetDelegate _delegate in _delegates.OrderBy(t => t.Name.LocalName)) { section.AddInLine(new MarkdownInlineLink(MarkdownText.Bold(_delegate.Name.LocalName), FormatFilename(_delegate.Name.FullName + Ext.MD))); section.Add(ConvertDotNet.DotNetCommentGroupToMarkdown(_delegate.SummaryComments, _delegate)); section.Add(new MarkdownLine()); } }
private MarkdownSection BuildMasterSummary(DotNetDocumentationFile xmlDocumentation, DotNetQualifiedClassNameTreeNode node) { string header = (new MarkdownInlineLink(node.Value, TableOfContentsFilename(node.Value))).ToMarkdownString(null); MarkdownSection section = new MarkdownSection(header); List <DotNetType> types = xmlDocumentation.Types.Where(t => t.Name.FullNamespace == node.Value).ToList(); foreach (DotNetType type in types.OrderBy(t => t.Name)) { section.Add(new MarkdownLine(new MarkdownInlineLink(type.Name, FormatFilename(type.Name + Ext.MD)))); } List <DotNetDelegate> _delegates = xmlDocumentation.Delegates.Where(d => d.Name.FullNamespace == node.Value).ToList(); foreach (DotNetDelegate _delegate in _delegates.OrderBy(d => d.Name)) { section.Add(new MarkdownLine(new MarkdownInlineLink(_delegate.Name, FormatFilename(_delegate.Name + Ext.MD)))); } foreach (DotNetQualifiedClassNameTreeNode child in node.Children.OrderBy(c => c.Value)) { section.AddSection(BuildMasterSummary(xmlDocumentation, child)); } return(section); }
public void MarkdownSection_ToMarkdown_TextThenSection() { //arrange MarkdownSection sectionA = new MarkdownSection("A"); MarkdownText text = new MarkdownText("Text"); sectionA.Add(text); MarkdownSection sectionB = sectionA.AddSection("B"); //act string result = sectionA.ToMarkdownString(); //assert Assert.AreEqual("# A\n\nText\n\n## B\n\n", result); }