[valadoc] libvaladoc/html: process Paragraph.horizontal_align



commit fd84bde20702ec83737b94ee127858198a3fc8b2
Author: Florian Brosch <flo brosch gmail com>
Date:   Tue Feb 1 22:46:05 2011 +0100

    libvaladoc/html: process Paragraph.horizontal_align

 src/libvaladoc/html/htmlrenderer.vala |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/src/libvaladoc/html/htmlrenderer.vala b/src/libvaladoc/html/htmlrenderer.vala
index 66ef4d4..fc6b698 100755
--- a/src/libvaladoc/html/htmlrenderer.vala
+++ b/src/libvaladoc/html/htmlrenderer.vala
@@ -299,7 +299,25 @@ public class Valadoc.Html.HtmlRenderer : ContentRenderer {
 	}
 
 	public override void visit_paragraph (Paragraph element) {
-		writer.start_tag ("p");
+		//FIXME: the extra-field is just a workarround for the current codegen ...
+		if (element.horizontal_align == null) {
+			writer.start_tag ("p");
+		} else {
+			HorizontalAlign tmp = element.horizontal_align;
+			switch (tmp) {
+			case HorizontalAlign.CENTER:
+				writer.start_tag ("p", {"style", "text-align: center;"});
+				break;
+
+			case HorizontalAlign.RIGHT:
+				writer.start_tag ("p", {"style", "text-align: right;"});
+				break;
+
+			default:
+				writer.start_tag ("p");
+				break;
+			}
+		}
 		element.accept_children (this);
 		writer.end_tag ("p");
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]