예제 #1
0
        protected virtual MarkdownPage GenerateDocumentationIndex([NotNull, ItemNotNull] IEnumerable <MarkdownPage> modulePages)
        {
            var moduleList = new MarkdownList();

            foreach (var modulePage in modulePages)
            {
                moduleList.AppendItem(new MarkdownLink($"modules/{modulePage.Name}.md", modulePage.Title.Humanize().Transform(To.TitleCase)));
            }

            var page = new MarkdownPage("index", "Index")
                       .AppendSection
                       (
                new MarkdownSection("Available Command Modules", 3)
                .AppendContent
                (
                    moduleList
                )
                       );

            page.Footer = "<sub><sup>Generated by DIGOS.Ambassador.Doc</sup></sub>";

            return(page);
        }
예제 #2
0
        protected virtual MarkdownPage GenerateModuleDocumentation([NotNull] ModuleInformation module)
        {
            var page = new MarkdownPage
                       (
                module.GetNameChain().Replace(" ", "_"),
                $"{module.GetNameChain().Humanize()} commands".Transform(To.TitleCase)
                       );

            page.Footer = "<sub><sup>Generated by DIGOS.Ambassador.Doc</sup></sub>";

            page.AppendSection(GenerateSummarySection(module));

            if (module.Submodules.Any())
            {
                page.AppendSection(GenerateSubmodulesSection(module));
            }

            if (module.Commands.Any())
            {
                page.AppendSection(GenerateCommandsSection(module));
            }

            return(page);
        }