[gtk-doc] Use a table for union members
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] Use a table for union members
- Date: Wed, 12 Feb 2014 15:14:29 +0000 (UTC)
commit 36db270e379b93fd8f265b186f2d86082bd1ff14
Author: William Jon McCann <william jon mccann gmail com>
Date: Mon Feb 10 14:45:07 2014 -0500
Use a table for union members
https://bugzilla.gnome.org/show_bug.cgi?id=723991
gtkdoc-mkdb.in | 23 ++++++++++++++++-------
style/style.css | 10 ++++++++++
2 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index d509201..6db6f9d 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -1865,22 +1865,31 @@ sub OutputUnion {
my $missing_parameters = "";
my $unused_parameters = "";
- $desc .= "<variablelist role=\"union\">\n";
+ $desc .= <<EOF;
+<refsect3 role="union_members">\n<title>Members</title>
+<informaltable role="union_members_table" pgwide="1" frame="none">
+<tgroup cols="3">
+<colspec colname="name" colwidth="300px"/>
+<colspec colname="description"/>
+<colspec colname="annotations" colwidth="200px"/>
+<tbody>
+EOF
+
while (@fields) {
my $field_name = shift @fields;
my $text = shift @fields;
my $field_descr = $field_descrs{$field_name};
my $param_annotations = "";
- $desc .= "<varlistentry><term>$text</term>\n";
+ $desc .= "<row><entry role=\"union_member_name\"><para>$text</para></entry>\n";
if (defined $field_descr) {
($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);
$field_descr = &ConvertMarkDown($symbol, $field_descr);
- $field_descr .= $param_annotations;
+
# trim
$field_descr =~ s/^(\s|\n)+//msg;
$field_descr =~ s/(\s|\n)+$//msg;
- $desc .= "<listitem>$field_descr</listitem>\n";
+ $desc .= "<entry role=\"union_member_description\">$field_descr</entry>\n<entry
role=\"union_member_annotations\">$param_annotations</entry>\n";
delete $field_descrs{$field_name};
} else {
&LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
@@ -1890,11 +1899,11 @@ sub OutputUnion {
} else {
$missing_parameters = $field_name;
}
- $desc .= "<listitem />\n";
+ $desc .= "<entry /><entry />\n";
}
- $desc .= "</varlistentry>\n";
+ $desc .= "</row>\n";
}
- $desc .= "</variablelist>";
+ $desc .= "</tbody></tgroup></informaltable>\n</refsect3>";
foreach my $field_name (keys %field_descrs) {
&LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Field description for $symbol"."::"."$field_name is not used from source code comment
block.");
diff --git a/style/style.css b/style/style.css
index 8a1afcf..603b851 100644
--- a/style/style.css
+++ b/style/style.css
@@ -193,6 +193,16 @@ div.informaltable table td, div.informaltable table th
color: #555753;
}
+.union_member_name
+{
+ text-align: right;
+}
+
+.union_member_annotations
+{
+ color: #555753;
+}
+
div.table table
{
border-collapse: collapse;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]