public override void GenerateBody() { base.GenerateBody(); Div page = new Div(Compatibility); page.GlobalAttributes.Class.Value = "about"; H1 heading = new H1(Compatibility); heading.Add(new SimpleHTML5Text(Compatibility) { Text = "About" }); page.Add(heading); foreach (var text in AboutTexts) { var p1 = new Paragraph(Compatibility); var text1 = new SimpleHTML5Text(Compatibility) {Text = text}; p1.Add(text1); page.Add(p1); } foreach (var text in AboutLinks) { var p1 = new Paragraph(Compatibility); var anch = new Anchor(Compatibility); anch.HRef.Value = text; anch.GlobalAttributes.Title.Value = text; var text3 = new SimpleHTML5Text(Compatibility) {Text = text}; anch.Add(text3); p1.Add(anch); page.Add(p1); } BodyElement.Add(page); }
private void AddContent() { var pageData = new Div(Compatibility); var heading = new H1(Compatibility); heading.Add(new SimpleHTML5Text(Compatibility) { Text = "Converter use license" }); pageData.Add(heading); var p1 = new Paragraph(Compatibility); p1.Add(new SimpleHTML5Text(Compatibility) { Text = "This file was generated by Lord KiRon's FB2EPUB converter." }); p1.Add(new SimpleHTML5Text(Compatibility) { Text = "(This book might contain copyrighted material, author of the converter bears no responsibility for it's usage)" }); pageData.Add(p1); var anch = new Anchor(Compatibility); p1 = new Paragraph(Compatibility); anch.Add(new SimpleHTML5Text(Compatibility) { Text = @"http://www.fb2epub.net" }); anch.HRef.Value = @"http://www.fb2epub.net"; p1.Add(anch); pageData.Add(p1); anch = new Anchor(Compatibility); p1 = new Paragraph(Compatibility); anch.Add(new SimpleHTML5Text(Compatibility) { Text = @"https://code.google.com/p/fb2epub/" }); anch.HRef.Value = @"https://code.google.com/p/fb2epub/"; p1.Add(anch); pageData.Add(p1); Content = pageData; }
/// <summary> /// Creates block element based on paragraph type /// </summary> /// <param name="type"></param> /// <returns></returns> private static HTMLItem CreateBlock(ParagraphConvTargetEnumV3 type) { HTMLItem paragraph; switch (type) { case ParagraphConvTargetEnumV3.H1: paragraph = new H1(HTMLElementType.HTML5); break; case ParagraphConvTargetEnumV3.H2: paragraph = new H2(HTMLElementType.HTML5); break; case ParagraphConvTargetEnumV3.H3: paragraph = new H3(HTMLElementType.HTML5); break; case ParagraphConvTargetEnumV3.H4: paragraph = new H4(HTMLElementType.HTML5); break; case ParagraphConvTargetEnumV3.H5: paragraph = new H5(HTMLElementType.HTML5); break; case ParagraphConvTargetEnumV3.H6: paragraph = new H6(HTMLElementType.HTML5); break; default: // Paragraph or anything else paragraph = new Paragraph(HTMLElementType.HTML5); break; } return paragraph; }