Esempio n. 1
0
        // Render/Text/Hierarchical
        public static string RenderToHierarchicalText(this ProjectArchNode project)
        {
            var builder = new HierarchicalStringBuilder();

            builder.AppendObject(project);
            return(builder.ToString());
        }
Esempio n. 2
0
 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));
     }
 }
Esempio n. 3
0
 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);
         }
     }
 }
Esempio n. 4
0
        // Render/Markdown
        public static string RenderToMarkdown(this ProjectArchNode project)
        {
            var builder = new StringBuilder();

            builder.AppendTableOfContents(project);
            builder.AppendLine();
            builder.AppendBody(project);
            return(builder.ToString());
        }
Esempio n. 5
0
 private static void AppendBody(this StringBuilder builder, ProjectArchNode project)
 {
     foreach (var node in project.DescendantNodesAndSelf)
     {
         if (!node.IsDefaultGroup())
         {
             builder.AppendLine(node.GetDisplayString());
         }
     }
 }
Esempio n. 6
0
        // 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());
        }