[valadoc] Tidy up appending of colons to gtk-doc comments
- From: Florian Brosch <flobrosch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [valadoc] Tidy up appending of colons to gtk-doc comments
- Date: Fri, 17 Aug 2012 23:24:34 +0000 (UTC)
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]