[gtk-doc] Use a table for the function synopsis



commit 84c15bdc5d4a7da7601f77a8aed37c5c2cc298c4
Author: William Jon McCann <william jon mccann gmail com>
Date:   Sun Feb 9 17:49:38 2014 -0500

    Use a table for the function synopsis
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723991

 gtkdoc-mkdb.in  |   25 +++++++++++++------------
 style/style.css |   17 +++++++++++++++++
 2 files changed, 30 insertions(+), 12 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 6df1038..de18ce0 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -810,8 +810,15 @@ EOF
                   $functions_synop = <<EOF;
 <refsect1 id="$section_id.functions" role="functions_proto">
 <title role="functions_proto.title">Functions</title>
-<synopsis>
-${functions_synop}</synopsis>
+<informaltable pgwide="1" frame="none">
+<tgroup cols="2">
+<colspec colname="return" colwidth="150px"/>
+<colspec colname="name"/>
+<tbody>
+${functions_synop}
+</tbody>
+</tgroup>
+</informaltable>
 </refsect1>
 EOF
                 }
@@ -2153,18 +2160,17 @@ sub OutputFunction {
 
     my ($symbol_output, $symbol_desc_output);
     if ($symbol_len < $SYMBOL_FIELD_WIDTH) {
-        $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3"
-            . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len));
+        $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3";
         $symbol_desc_output = "$char1$char2$symbol$char3"
             . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len));
     } else {
-        $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3\n"
-            . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));
+        $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3";
         $symbol_desc_output = "$char1$char2$symbol$char3\n"
             . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));
     }
 
-    my $synop = $ret_type_output . $symbol_output . '(';
+    my $synop = "<row><entry role=\"function_type\">${ret_type_output}</entry><entry 
role=\"function_name\">${symbol_output} ()</entry></row>\n";
+
     my $desc = "<refsect2 id=\"$id\" role=\"function\"$condition>\n<title>${symbol} ()</title>\n";
 
     $desc .= MakeIndexterms($symbol, $id);
@@ -2182,12 +2188,8 @@ sub OutputFunction {
         my $field_name = $fields[$i];
 
         if ($i == 1) {
-            $synop .= "$field_name";
             $desc  .= "$field_name";
         } else {
-            $synop .= ",\n"
-                . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH))
-                . " $field_name";
             $desc  .= ",\n"
                 . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH))
                 . " $field_name";
@@ -2195,7 +2197,6 @@ sub OutputFunction {
 
     }
 
-    $synop .= ");\n";
     $desc  .= ");</programlisting>\n";
 
     $desc .= &MakeDeprecationNote($symbol);
diff --git a/style/style.css b/style/style.css
index f7ecc5f..6a5205d 100644
--- a/style/style.css
+++ b/style/style.css
@@ -136,6 +136,23 @@ a:hover
   color: #729fcf;
 }
 
+div.informaltable table
+{
+  border-collapse: separate;
+  border-spacing: 20px 3px;
+  border: none;
+}
+
+div.informaltable table td, div.informaltable table th
+{
+  vertical-align: top;
+}
+
+.function_type
+{
+  text-align: right;
+}
+
 div.table table
 {
   border-collapse: collapse;


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