[valadoc] Tidy up appending of colons to gtk-doc comments



commit 25abfb26caf6e19a84d72191403b4f0163fe45c0
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Aug 15 00:06:15 2012 +0200

    Tidy up appending of colons to gtk-doc comments
    
    gtk-doc prefers to have colons on the first line of every
    documentation comment.

 src/doclets/gtkdoc/gcomment.vala  |    4 ++--
 src/doclets/gtkdoc/generator.vala |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/doclets/gtkdoc/gcomment.vala b/src/doclets/gtkdoc/gcomment.vala
index 99c5f67..4e683ca 100644
--- a/src/doclets/gtkdoc/gcomment.vala
+++ b/src/doclets/gtkdoc/gcomment.vala
@@ -53,13 +53,13 @@ public class Gtkdoc.GComment {
 	public string[] returns_annotations;
 	public Gee.List<Header> versioning = new Gee.LinkedList<Header> ();
 	public string[] see_also;
+	public bool is_section;
 
 	public string to_string () {
 		var builder = new StringBuilder ();
 
-		builder.append_printf ("/**\n * %s", symbol);
+		builder.append_printf ("/**\n * %s", (is_section ? "SECTION:%s" : "%s:").printf (symbol));
 		if (symbol_annotations != null && symbol_annotations.length > 0) {
-			builder.append_c (':');
 			foreach (var annotation in symbol_annotations) {
 				builder.append_printf (" (%s)", annotation);
 			}
diff --git a/src/doclets/gtkdoc/generator.vala b/src/doclets/gtkdoc/generator.vala
index 3bb57fc..8c7831f 100644
--- a/src/doclets/gtkdoc/generator.vala
+++ b/src/doclets/gtkdoc/generator.vala
@@ -178,7 +178,8 @@ public class Gtkdoc.Generator : Api.Visitor {
 			return;
 		}
 
-		var gcomment = create_gcomment ("SECTION:%s".printf (get_section (filename)), comment);
+		var gcomment = create_gcomment (get_section (filename), comment);
+		gcomment.is_section = true;
 		gcomment.short_description = true;
 		file_data.section_comment = gcomment;
 	}



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