public void WriteSitemapIndex(string OutputPath)
        {
            // Gather all the pages
            List <APIPage> AllPages = new List <APIPage>(GatherPages());

            // Find the shortest link path to each member
            Dictionary <string, List <APIMember> > MemberIndexLinks = new Dictionary <string, List <APIMember> >();

            foreach (APIMember Member in AllPages.OfType <APIMember>())
            {
                // Find or create the list of members for this link path
                List <APIMember> Members;
                if (!MemberIndexLinks.TryGetValue(Member.FullName, out Members))
                {
                    Members = new List <APIMember>();
                    MemberIndexLinks.Add(Member.FullName, Members);
                }

                // Remove any members
                Members.RemoveAll(x => x.HasParent(Member));
                if (!Members.Any(x => Member.HasParent(x)))
                {
                    Members.Add(Member);
                }
            }

            // Create all the root pages
            List <SitemapNode> RootNodes = new List <SitemapNode>();

            foreach (APIPage Page in AllPages)
            {
                if (!(Page is APIMember) && Page.ShouldOutputPage())
                {
                    RootNodes.Add(new SitemapNode(Page.Name, Page.SitemapLinkPath));
                }
            }
            foreach (KeyValuePair <string, List <APIMember> > MemberIndexLink in MemberIndexLinks)
            {
                foreach (APIMember Member in MemberIndexLink.Value)
                {
                    if (Member.ShouldOutputPage())
                    {
                        RootNodes.Add(new SitemapNode(MemberIndexLink.Key, Member.SitemapLinkPath));
                    }
                }
            }

            // Write the index file
            Sitemap.WriteIndexFile(OutputPath, RootNodes);
        }
예제 #2
0
        public void WriteSitemapContents(string OutputPath)
        {
            List <SitemapNode> RootNodes = new List <SitemapNode>();

            RootNodes.Add(new SitemapNode("Contents", SitemapLinkPath));
            RootNodes.Add(new SitemapNode("Getting started", GettingStarted.SitemapLinkPath));
            foreach (APIModuleIndex ChildModuleIndex in ChildModuleIndexes)
            {
                RootNodes.Add(ChildModuleIndex.CreateSitemapNode());
            }
            RootNodes.Add(new SitemapNode("All constants", ConstantIndex.SitemapLinkPath));
            RootNodes.Add(new SitemapNode("All functions", FunctionIndex.SitemapLinkPath));
            RootNodes.Add(new SitemapNode("All enums", EnumIndex.SitemapLinkPath));
            RootNodes.Add(new SitemapNode("All classes", RecordIndex.SitemapLinkPath));
            RootNodes.Add(new SitemapNode("Class hierarchy", RecordHierarchy.SitemapLinkPath));
            Sitemap.WriteContentsFile(OutputPath, RootNodes);
        }
예제 #3
0
        public void WriteSitemapContents(string OutputPath)
        {
            List <SitemapNode> RootNodes = new List <SitemapNode>();

            if (bIsRootCategory)
            {
                RootNodes.Add(new SitemapNode("Contents", SitemapLinkPath));
            }
            foreach (APIPage SubCategory in SubCategories.Values)
            {
                RootNodes.AddRange(SubCategory.CreateSitemapNodes());
            }
            foreach (APIPage Action in Actions)
            {
                RootNodes.AddRange(Action.CreateSitemapNodes());
            }
            Sitemap.WriteContentsFile(OutputPath, RootNodes);
        }