public void CreateSectionFilesDirectory(string sectionPath, Section section) { var filename = $"{UtilityHelper.CreateFriendlyName(section.Name)}.html"; var htmlContent = _htmlParser.CreateSectionHtmlPage(section); UtilityHelper.CreateUpdateFile(sectionPath, filename, htmlContent); }
public string CreateDisciplineHtmlPage(Discipline discipline) { var html = new StringBuilder(); html.AppendLine($"<h1>{discipline.Name} IPSC Rules</h1>"); foreach (var chapter in discipline.Chapters) { html.AppendLine($"<h5>{chapter.Numeric} {chapter.Name}</h5>"); html.AppendLine($"<a href=\"{UtilityHelper.CreateFriendlyName(chapter.Name)}.html\">Read More...</a>"); } return(ParseStringBuilder(html)); }
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)); }
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)); }