[valadoc] HTML doclet: don't write '-' with no description
- From: Ben Iofel <beniofel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [valadoc] HTML doclet: don't write '-' with no description
- Date: Sun, 10 Jan 2016 20:33:39 +0000 (UTC)
commit 4705141291765beddbbe56258fa089ac53e55df6
Author: Ben Iofel <iofelben+github gmail com>
Date: Fri Jan 8 17:54:52 2016 -0500
HTML doclet: don't write '-' with no description
src/libvaladoc/html/basicdoclet.vala | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/libvaladoc/html/basicdoclet.vala b/src/libvaladoc/html/basicdoclet.vala
index 7247f2b..67e76ad 100644
--- a/src/libvaladoc/html/basicdoclet.vala
+++ b/src/libvaladoc/html/basicdoclet.vala
@@ -434,6 +434,10 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
writer.end_tag ("div");
}
+ private bool has_brief_description (Api.Node element) {
+ return element.documentation != null;
+ }
+
private void write_brief_description (Api.Node element , Api.Node? pos) {
Content.Comment? doctree = element.documentation;
if (doctree == null) {
@@ -917,8 +921,10 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
if (child.name != null) {
writer.start_tag ("li", {"class", cssresolver.resolve (child)});
writer.link (get_link (child, parent), child.name);
- writer.text (" - ");
- this.write_brief_description (child, parent);
+ if (has_brief_description (child)) {
+ writer.text (" - ");
+ this.write_brief_description (child, parent);
+ }
writer.end_tag ("li");
if (with_childs == true) {
write_children (child, Api.NodeType.INTERFACE, "Interfaces", parent);
@@ -979,8 +985,10 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
} else {
writer.link (get_link (child, container), child.name);
}
- writer.text (" - ");
- write_brief_description (child, container);
+ if (has_brief_description (child)) {
+ writer.text (" - ");
+ write_brief_description (child, container);
+ }
} else {
writer.start_tag ("span", {"class", css_leaf_code_definition});
if (child is Symbol && ((Symbol) child).is_deprecated) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]