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

[Xen-changelog] [xen master] docs/parse-support-md: Unify identical [*] in footnotes



commit 6bd34dc33a237df1af0b4bfec212b5c9e8705745
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Thu Apr 12 12:59:24 2018 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Thu Apr 12 17:12:12 2018 +0100

    docs/parse-support-md: Unify identical [*] in footnotes
    
    A section in the SUPPORT.md may mention multiple
       Status, something: Supported
    and then have some text.  The text is linked to from [*] footnotes
    in the table.  But, this means that each bit of text needs to
    apply to multiple rows.
    
    Before this commit this was a separate [*] after each applicable item.
    But multiple apparently-different links to the same thing are annoying
    for the reader.
    
    So, in this commit we combine them.  Formatting the result is not
    entirely trivial.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
    Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
    ---
    v3: New patch
    v3.1: Drop `}' in multi-row [*] notes.  I put this in to help work
       around firefox bugs eg
         https://bugzilla.mozilla.org/show_bug.cgi?id=244135
       but I have been convinced it is not generally wanted.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 docs/parse-support-md | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/docs/parse-support-md b/docs/parse-support-md
index 83768cf7ef..decda33fb6 100755
--- a/docs/parse-support-md
+++ b/docs/parse-support-md
@@ -17,6 +17,7 @@ use Tie::IxHash;
 use IO::File;
 use CGI qw(escapeHTML);
 use Data::Dumper;
+use POSIX;
 
 #---------- accumulating input/output ----------
 
@@ -285,9 +286,14 @@ sub count_rows_sectnode ($) {
     $rows++ if $sectnode->{Status};
     $rows += count_rows_sectlist $sectnode->{Children};
     $sectnode->{Rows} = $rows;
+    $sectnode->{RealSect}{Rows} = $rows;
     return $rows;
 }
 
+# Now we have
+#   $sectnode->{Rows}
+#   $sectnode->{RealSect}{Rows}
+
 sub count_rows_sectlist ($) {
     my ($sectlist) = @_;
     my $rows = 0;
@@ -349,22 +355,34 @@ sub write_output_row ($) {
     }
     for (my $i=0; $i<@version_urls; $i++) {
         my $st = $sectnode->{Status}[$i];
+
+        my $colspan = $sectnode->{RealSect}{ColSpan}[$i];
+        my $nextcell = '';
+        if (!defined $colspan) { # first row of this RealSect
+            $colspan= ' colspan="2"';
+            if ($sectnode->{RealSect}{HasText}[$i] && $st
+                && $sectnode->{RealSect}{Anchor}) {
+                my $rows = $sectnode->{RealSect}{Rows};
+                $nextcell = sprintf '<td rowspan=%d>', $rows;
+                $nextcell .= sprintf '<a href="%s#%s">[*]</a>',
+                    $version_urls[$i], $sectnode->{RealSect}{Anchor};
+                $nextcell .= '</td>';
+                $colspan = '';
+            }
+            $sectnode->{RealSect}{ColSpan}[$i] = $colspan;
+        }
+
         $st //= '-';
-        o('<td>');
+        o("<td$colspan>");
         my $end_a = '';
         if ($sectnode->{Key} eq 'release-support--xen-version') {
             o(sprintf '<a href="%s">', $version_urls[$i]);
             $end_a = '</a>';
         }
         o(escapeHTML($st));
-        if ($sectnode->{RealSect}{HasText}[$i]
-            && $sectnode->{Status}[$i]
-            && $sectnode->{RealSect}{Anchor}) {
-            o(sprintf '<a href="%s#%s">[*]</a>',
-              $version_urls[$i], $sectnode->{RealSect}{Anchor});
-        }
         o($end_a);
         o('</td>');
+        o($nextcell);
     }
     o("</tr>\n");
 }      
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.