예제 #1
0
        public string CreateChapterHtmlPage(Chapter chapter)
        {
            var html = new StringBuilder();

            html.AppendLine($"<h1>{chapter.Numeric} {chapter.Name}</h1>");
            html.AppendLine($"{chapter.Description}");

            foreach (var chapterSection in chapter.Sections)
            {
                html.AppendLine($"<h5>{chapterSection.Numeric} {chapterSection.Name}</h5>");
                html.AppendLine($"{chapterSection.Description}");
                html.AppendLine($"<a href=\"{UtilityHelper.CreateFriendlyName(chapter.Name)}/{UtilityHelper.CreateFriendlyName(chapterSection.Name)}.html\">Read More...</a>");
            }

            return(ParseStringBuilder(html));
        }
예제 #2
0
        public string CreateIndexHtmlPage(List <Discipline> disciplines)
        {
            var html = new StringBuilder();

            html.AppendLine($"<h1>IPSC Disciplines</h1>");
            html.AppendLine($"WARNING!: <br>");
            html.AppendLine($"Rules 3.2.1 and 4.1.1.2 have bullet points which do not translate and need manual entry. <br>");
            html.AppendLine($"Rules with names that include parantheses will end up in description.");

            foreach (var discipline in disciplines)
            {
                html.AppendLine($"<h5>{discipline.Name}</h5>");
                html.AppendLine($"<a href=\"{UtilityHelper.CreateFriendlyName(discipline.Name)}/{UtilityHelper.CreateFriendlyName(discipline.Name)}.html\">Read More...</a>");
            }

            return(ParseStringBuilder(html));
        }