Skip to contentSkip to conversation

Support matrix: add missing caveat footnotes

PATCH In review Ian Jackson 4 participants 8 messages May 15, 2018

lore
Share & tools
lore
#0 lore raw

cover Support matrix: add missing caveat footnotes

From: Ian Jackson <[email protected]>

Lars spotted that the support matrix
https://xenbits.xen.org/docs/unstable/support-matrix.html
is missing some footnotes. These three patches fix this. I think this is release-critical.

Ian Jackson (3):
docs/parse-support-md: Rename RealSect to RealInSect docs/parse-support-md: Provide $sectnode->{RealSectNode} docs/parse-support-md: Correctly process caveats in multi-status
sections

 docs/parse-support-md | 54 +++++++++++++++++++++++++++------------------------
 1 file changed, 29 insertions(+), 25 deletions(-)
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH 1/3 docs/parse-support-md: Rename RealSect to RealInSect

This makes the distinction between insections and sectnodes clearer.

No functional change.

---
 docs/parse-support-md | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)
docs/parse-support-md +22 -22
index 1c82f56..8af3acc 100755
@@ -34,16 +34,16 @@ our $toplevel_sectlist = new_sectlist();
 # $sectlist->{KEY}{Children} = a further $sectlist
 # $sectlist->{KEY}{Key} = KEY
 # $sectlist->{KEY}{HasCaveat}[VI] = trueish iff other in a Para
-# $sectlist->{KEY}{RealSect} = containing real section in @insections, so
-# $sectlist->{KEY}{RealSect}{HasDescription} = VI for some Emph in Para
-# $sectlist->{KEY}{RealSect}{Anchor} = value for < id="" > in the pandoc html
+# $sectlist->{KEY}{RealInSect} = containing real section in @insections, so
+# $sectlist->{KEY}{RealInSect}{HasDescription} = VI for some Emph in Para
+# $sectlist->{KEY}{RealInSect}{Anchor} = value for < id="" > in the pandoc html
 # A $sectnode represents a single section from the original markdown
 # document.  Its subsections are in Children.
 #
 # Also, the input syntax:
 #    Status, something or other: Supported
 # is treated as a $sectnode, is as if it were a subsection -
-# one called `something or other'.
+# one called `something or other'.  That is not a `real' section.
 #
 # KEY is the Anchor, or derived from the `something or other'.
 # It is used to match up identical features in different versions.
@@ -70,12 +70,12 @@ sub find_current_sectnode () {
     die unless @insections;
 
     my $sectnode;
-    my $realsect;
+    my $realinsect;
     foreach my $s (@insections) {
         my $sectlist = $sectnode
             ? $sectnode->{Children} : $toplevel_sectlist;
         my $key = $s->{Key};
-        $realsect = $s if $s->{Anchor};
+        $realinsect = $s if $s->{Anchor};
         tie %$sectlist, 'Tie::IxHash' unless tied %$sectlist;
 #print STDERR "FIND_CURRENT_SECTNODE ", Dumper($s);
         $sectlist->{$key} //=
@@ -83,7 +83,7 @@ sub find_current_sectnode () {
              Children => new_sectlist(),
              Headline => $s->{Headline},
              Key => $key,
-             RealSect => $realsect,
+             RealInSect => $realinsect,
              HasCaveat => [],
             };
         $sectnode = $sectlist->{$key};
@@ -303,21 +303,21 @@ sub count_rows_sectlist ($);
 sub count_rows_sectnode ($) {
     my ($sectnode) = @_;
     my $rows = 0;
-    $sectnode->{RealSect}{OwnRows} //= 0;
+    $sectnode->{RealInSect}{OwnRows} //= 0;
     if ($sectnode->{Status}) {
         $rows++;
-        $sectnode->{RealSect}{OwnRows}++;
+        $sectnode->{RealInSect}{OwnRows}++;
     }
     $rows += count_rows_sectlist $sectnode->{Children};
     $sectnode->{Rows} = $rows;
-    $sectnode->{RealSect}{Rows} = $rows;
+    $sectnode->{RealInSect}{Rows} = $rows;
     return $rows;
 }
 
 # Now we have
 #   $sectnode->{Rows}
-#   $sectnode->{RealSect}{Rows}
-#   $sectnode->{RealSect}{OwnRows}
+#   $sectnode->{RealInSect}{Rows}
+#   $sectnode->{RealInSect}{OwnRows}
 
 sub count_rows_sectlist ($) {
     my ($sectlist) = @_;
@@ -344,9 +344,9 @@ sub o { print @_ or die $!; }
 our @pending_headings;
 
 sub docref_a ($$) {
-    my ($i, $realsect) = @_;
+    my ($i, $realinsect) = @_;
     return sprintf '<a href="%s#%s">',
-        $version_urls[$i], $realsect->{Anchor};
+        $version_urls[$i], $realinsect->{Anchor};
 }
 
 sub write_output_row ($) {
@@ -372,9 +372,9 @@ sub write_output_row ($) {
             if !%{ $heading->{Children} };
         o(' align="left">');
         my $end_a = '';
-        my $desc_i = $heading->{RealSect}{HasDescription};
+        my $desc_i = $heading->{RealInSect}{HasDescription};
         if (defined $desc_i) {
-            o(docref_a $desc_i, $heading->{RealSect});
+            o(docref_a $desc_i, $heading->{RealInSect});
             $end_a= '</a>';
         }
         o($heading->{Headline});
@@ -394,22 +394,22 @@ sub write_output_row ($) {
     for (my $i=0; $i<@version_urls; $i++) {
         my $st = $sectnode->{Status}[$i];
 
-        my $colspan = $sectnode->{RealSect}{ColSpan}[$i];
+        my $colspan = $sectnode->{RealInSect}{ColSpan}[$i];
         my $nextcell = '';
-        if (!defined $colspan) { # first row of this RealSect
+        if (!defined $colspan) { # first row of this RealInSect
             $colspan= ' colspan="2"';
             if ($sectnode->{HasCaveat}[$i] && $st
-                && $sectnode->{RealSect}{Anchor}) {
-                my $rows = $sectnode->{RealSect}{OwnRows};
+                && $sectnode->{RealInSect}{Anchor}) {
+                my $rows = $sectnode->{RealInSect}{OwnRows};
                 $nextcell = '<td';
                 $nextcell .= sprintf ' rowspan=%d', $rows if $rows>1;
                 $nextcell .= '>';
-                $nextcell .= docref_a $i, $sectnode->{RealSect};
+                $nextcell .= docref_a $i, $sectnode->{RealInSect};
                 $nextcell .= '[*]</a>';
                 $nextcell .= '</td>';
                 $colspan = '';
             }
-            $sectnode->{RealSect}{ColSpan}[$i] = $colspan;
+            $sectnode->{RealInSect}{ColSpan}[$i] = $colspan;
         }
 
         $st //= '-';
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw

PATCH 2/3 docs/parse-support-md: Provide $sectnode->{RealSectNode}

In reply to Ian Jackson

No functional change yet.

---
 docs/parse-support-md | 4 ++++
 1 file changed, 4 insertions(+)
docs/parse-support-md +4 -0
index 8af3acc..278072f 100755
@@ -33,6 +33,7 @@ our $toplevel_sectlist = new_sectlist();
 # $sectlist->{KEY}{Status}[VI] = absent or markdown content
 # $sectlist->{KEY}{Children} = a further $sectlist
 # $sectlist->{KEY}{Key} = KEY
+# $sectlist->{KEY}{RealSectNode} = us, or our parent
 # $sectlist->{KEY}{HasCaveat}[VI] = trueish iff other in a Para
 # $sectlist->{KEY}{RealInSect} = containing real section in @insections, so
 # $sectlist->{KEY}{RealInSect}{HasDescription} = VI for some Emph in Para
@@ -71,6 +72,7 @@ sub find_current_sectnode () {
 
     my $sectnode;
     my $realinsect;
+    my $realsectnode;
     foreach my $s (@insections) {
         my $sectlist = $sectnode
             ? $sectnode->{Children} : $toplevel_sectlist;
@@ -87,6 +89,8 @@ sub find_current_sectnode () {
              HasCaveat => [],
             };
         $sectnode = $sectlist->{$key};
+        $realsectnode = $sectnode if $s->{Anchor};
+        $sectnode->{RealSectNode} = $realsectnode;
     }
     die unless $sectnode;
     return $sectnode;
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw

PATCH 3/3 docs/parse-support-md: Correctly process caveats in multi-status sections

In reply to Ian Jackson

When SUPPORT.md uses the syntax
Status, <some thing>: <support status>
the caveats were lost (not footnoted) because they were attached only to <some thing>.

Caveats occur in running text, so they are necessarily part of a real section, not an individual status line like that. So attach them to the RealSectNode, and look there for them.

---
 docs/parse-support-md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
docs/parse-support-md +3 -3
index 278072f..99ce547 100755
@@ -34,7 +34,7 @@ our $toplevel_sectlist = new_sectlist();
 # $sectlist->{KEY}{Children} = a further $sectlist
 # $sectlist->{KEY}{Key} = KEY
 # $sectlist->{KEY}{RealSectNode} = us, or our parent
-# $sectlist->{KEY}{HasCaveat}[VI] = trueish iff other in a Para
+# $sectlist->{KEY}{RealSectNode}{HasCaveat}[VI] = trueish iff other in a Para
 # $sectlist->{KEY}{RealInSect} = containing real section in @insections, so
 # $sectlist->{KEY}{RealInSect}{HasDescription} = VI for some Emph in Para
 # $sectlist->{KEY}{RealInSect}{Anchor} = value for < id="" > in the pandoc html
@@ -123,7 +123,7 @@ sub ri_Para {
 
     if ($had_feature) {
         my $sectnode = find_current_sectnode();
-        $sectnode->{HasCaveat}[$version_index] = 1;
+        $sectnode->{RealSectNode}{HasCaveat}[$version_index] = 1;
     } else {
         $insection->{HasDescription} //= $version_index;
     }
@@ -402,7 +402,7 @@ sub write_output_row ($) {
         my $nextcell = '';
         if (!defined $colspan) { # first row of this RealInSect
             $colspan= ' colspan="2"';
-            if ($sectnode->{HasCaveat}[$i] && $st
+            if ($sectnode->{RealSectNode}{HasCaveat}[$i] && $st
                 && $sectnode->{RealInSect}{Anchor}) {
                 my $rows = $sectnode->{RealInSect}{OwnRows};
                 $nextcell = '<td';
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#4 lore raw
In reply to Ian Jackson
Quoted 7 lines · Ian Jackson

From: Ian Jackson <[email protected]>

Lars spotted that the support matrix
https://xenbits.xen.org/docs/unstable/support-matrix.html
is missing some footnotes. These three patches fix this. I think this is release-critical.

Quoted 9 lines

Ian Jackson (3):
docs/parse-support-md: Rename RealSect to RealInSect docs/parse-support-md: Provide $sectnode->{RealSectNode} docs/parse-support-md: Correctly process caveats in multi-status
sections

 docs/parse-support-md | 54 +++++++++++++++++++++++++++------------------------
 1 file changed, 29 insertions(+), 25 deletions(-)

For the series:

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw

Juergen Gross writes ("Re: [PATCH for-4.11 0/3] Support matrix: add missing caveat footnotes"):

Quoted 2 lines

For the series:

Thanks.

FYI, example output is here:

https://xenbits.xen.org/people/iwj/2018/support-matrix-example-E/t.html

For my notes, I made this with

docs/support-matrix-generate HEAD https://xenbits.xen.org/docs/unstable-staging/SUPPORT.html refs/remotes/origin/staging-NN https://xenbits.xen.org/docs/NN-testing/SUPPORT.html >~/public_html/t.html rsync -vP ~/public_html/t.html xenbits:public_html/2018/support-matrix-example-E/

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw

This seems to address the issue
Lars

On 15/05/2018, 16:06, "Ian Jackson" <[email protected]> wrote:

Juergen Gross writes ("Re: [PATCH for-4.11 0/3] Support matrix: add missing caveat footnotes"):
> For the series:
> Release-acked-by: Juergen Gross <[email protected]>

Thanks.

FYI, example output is here:

https://xenbits.xen.org/people/iwj/2018/support-matrix-example-E/t.html

For my notes, I made this with

docs/support-matrix-generate HEAD https://xenbits.xen.org/docs/unstable-staging/SUPPORT.html refs/remotes/origin/staging-NN https://xenbits.xen.org/docs/NN-testing/SUPPORT.html >~/public_html/t.html rsync -vP ~/public_html/t.html xenbits:public_html/2018/support-matrix-example-E/

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by
#7 lore raw

On 15/05/2018, 16:23, "Lars Kurth" <[email protected]> wrote:

This seems to address the issue
Lars

On 15/05/2018, 16:06, "Ian Jackson" <[email protected]> wrote:

Juergen Gross writes ("Re: [PATCH for-4.11 0/3] Support matrix: add missing caveat footnotes"):
> For the series:
> Release-acked-by: Juergen Gross <[email protected]>

Thanks.

FYI, example output is here:

https://xenbits.xen.org/people/iwj/2018/support-matrix-example-E/t.html

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel