// Render/Text/Hierarchical public static string RenderToHierarchicalText(this ProjectArchNode project) { var builder = new HierarchicalStringBuilder(); builder.AppendObject(project); return(builder.ToString()); }
private static void AppendTableOfContents(this StringBuilder builder, ProjectArchNode project) { builder.AppendLine("Table of Contents".Header1()); foreach (var(node, link, uri) in project.DescendantNodesAndSelf.Where(i => i is ProjectArchNode or ModuleArchNode or NamespaceArchNode).GetLinks()) { builder.AppendLine(node.GetDisplayString(link, uri)); } }
private static void AppendObject(this HierarchicalStringBuilder builder, ProjectArchNode project) { using (builder.AppendTitle("Project: {0}", project.Name)) { foreach (var module in project.Modules) { builder.AppendObject(module); } } }
// Render/Markdown public static string RenderToMarkdown(this ProjectArchNode project) { var builder = new StringBuilder(); builder.AppendTableOfContents(project); builder.AppendLine(); builder.AppendBody(project); return(builder.ToString()); }
private static void AppendBody(this StringBuilder builder, ProjectArchNode project) { foreach (var node in project.DescendantNodesAndSelf) { if (!node.IsDefaultGroup()) { builder.AppendLine(node.GetDisplayString()); } } }
// Render/Text public static string RenderToText(this ProjectArchNode project) { var builder = new StringBuilder(); foreach (var node in project.DescendantNodesAndSelf) { if (!node.IsDefaultGroup()) { builder.AppendLine(node.GetDisplayString()); } } return(builder.ToString()); }