Skip to contentSkip to conversation

docs: Fix support matrix release notes link

PATCH In review Ian Jackson 3 participants 10 messages Dec 3, 2018 – Dec 10, 2018

lore
Share & tools
lore
#0 lore raw

cover docs: Fix support matrix release notes link

An example of the results of this can be seen here:
http://xenbits.xenproject.org/people/iwj/2018/support-matrix-example-4/t.html
http://xenbits.xenproject.org/people/iwj/2018/support-matrix-example-4/SUPPORT.html#release-support

The only part of this that needs to be backported is the part to change the syntax in SUPPORT.md, but we do need to wait for the other changes to hit master.

Ian Jackson (7):
docs/parse-support-md: More complete example runes docs/parse-support-md: Adjust some (commented-out) debugging docs/parse-support-md: Break out descr2key docs/parse-support-md: pandoc2html_inline: print failing json docs/parse-support-md: Correct handling of Status docs/parse-support-md: Allow definition lists for features SUPPORT.md: Turn release notes link into a proper link.

 SUPPORT.md            |  4 ++-
 docs/parse-support-md | 79 ++++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 62 insertions(+), 21 deletions(-)
Signature · 7 lines
2.11.0


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

PATCH 1/7 docs/parse-support-md: More complete example runes

---
 docs/parse-support-md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
docs/parse-support-md +2 -2
index 99ce547c11..66725236f2 100755
@@ -5,10 +5,10 @@
 #
 # usage:
 #   pandoc -t json SUPPORT.md >j-unstable
-#   git-cat-file ... | pandoc -t json >j-4.10
+#   git cat-file blob origin/staging-4.11:SUPPORT.md | pandoc -t json >j-4.11
 #   docs/parse-support-md \
 #            j-unstable https://xenbits/unstable/SUPPORT.html
-#            j-4.10 https://xenbits/4.10/SUPPORT.html
+#            j-4.11 https://xenbits/4.11/SUPPORT.html
 # or equivalent
 
 use strict;
Signature · 7 lines
2.11.0


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

PATCH 2/7 docs/parse-support-md: Adjust some (commented-out) debugging

In reply to Ian Jackson
---
 docs/parse-support-md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
docs/parse-support-md +2 -2
index 66725236f2..bbe4d045e1 100755
@@ -118,8 +118,8 @@ sub ri_Header {
 sub ri_Para {
     return unless @insections;
     my $insection = $insections[$#insections];
-#    print STDERR "ri_Para $version_index $had_feature ".
-#        $insection->{HasCaveat}." $insection->{Key}\n";
+#    print DEBUG "ri_Para ",
+#        Dumper($version_index, $had_feature, $insection);
 
     if ($had_feature) {
         my $sectnode = find_current_sectnode();
Signature · 7 lines
2.11.0


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

PATCH 3/7 docs/parse-support-md: Break out descr2key

In reply to Ian Jackson

We are going to want to reuse this. No functional change.

---
 docs/parse-support-md | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
docs/parse-support-md +14 -8
index bbe4d045e1..e2d0187dd1 100755
@@ -137,6 +137,19 @@ sub parse_feature_entry ($) {
     $sectnode->{Status}[$version_index] = $value;
 }
 
+sub descr2key ($) {
+    my ($descr) = @_;
+
+    die unless @insections;
+    my $insection = $insections[$#insections];
+
+    my $key = lc $descr;
+    $key =~ y/ /-/;
+    $key =~ y/-0-9A-Za-z//cd;
+    $key = $insection->{Anchor}.'--'.$key;
+    return $key;
+}
+
 sub ri_CodeBlock {
     my ($c) = @_;
     my ($infos, $text) = @$c;
@@ -164,17 +177,10 @@ sub ri_CodeBlock {
                     ($toplevel and 'top').
                     "\n$l\n ?");
 
-        die unless @insections;
-        my $insection = $insections[$#insections];
-
         if (length $descr) {
-            my $key = lc $descr;
-            $key =~ y/ /-/;
-            $key =~ y/-0-9A-Za-z//cd;
-            $key = $insection->{Anchor}.'--'.$key;
             push @insections,
                 {
-                 Key => $key,
+                 Key => descr2key($descr),
                  Headline => [{ t => 'Str', c => $descr }],
                 };
         }
Signature · 7 lines
2.11.0


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

PATCH 4/7 docs/parse-support-md: pandoc2html_inline: print failing json

In reply to Ian Jackson

If our run of pandoc to convert pieces of markup in our hand, into html, fails, print the json that was rejected.

No change in non-error cases.

---
 docs/parse-support-md | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
docs/parse-support-md +6 -5
index e2d0187dd1..a8f216f131 100755
@@ -247,10 +247,11 @@ sub pandoc2html_inline ($) {
     my ($content) = @_;
 
     my $json_fh = IO::File::new_tmpfile or die $!;
-    print $json_fh to_json([
-                            { unMeta => { } },
-                            [{ t => 'Para', c => $content }],
-                           ]) or die $!;
+    my $j = to_json([
+                     { unMeta => { } },
+                     [{ t => 'Para', c => $content }],
+                    ]) or die $!;
+    print $json_fh $j;
     flush $json_fh or die $!;
     seek $json_fh,0,0 or die $!;
 
@@ -270,7 +271,7 @@ sub pandoc2html_inline ($) {
             open STDIN, '<&', $json_fh or die $!;
             system 'json_pp';
         };
-        die "\n $? $!";
+        die "$j \n $? $!";
     }
 
     $html =~ s{^\<p\>}{} or die "$html ?";
Signature · 7 lines
2.11.0


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

PATCH 5/7 docs/parse-support-md: Correct handling of Status

In reply to Ian Jackson

In fact this was not markdown content, but just a string. We are however going to make it be markdown content. So adjust the comments, and the consumer.

---
 docs/parse-support-md | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
docs/parse-support-md +8 -3
index a8f216f131..16dd99f063 100755
@@ -30,7 +30,7 @@ our $toplevel_sectlist = new_sectlist();
 #   a tied hashref      something seen
 # (tied $sectlist)    is an object of type Tie::IxHash
 # $sectlist->{KEY} a $sectnode:
-# $sectlist->{KEY}{Status}[VI] = absent or markdown content
+# $sectlist->{KEY}{Status}[VI] = absent or string or markdown content
 # $sectlist->{KEY}{Children} = a further $sectlist
 # $sectlist->{KEY}{Key} = KEY
 # $sectlist->{KEY}{RealSectNode} = us, or our parent
@@ -341,7 +341,7 @@ sub count_rows_sectlist ($) {
 
 # After reprocess_sectlist,
 #    ->{Headline}   is in html
-#    ->{Status}     is in plain text
+#    ->{Status}     is (still) string or markdown content
 
 sub analyse_reprocess () {
     $maxdepth = 0;
@@ -430,7 +430,12 @@ sub write_output_row ($) {
             o(sprintf '<a href="%s">', $version_urls[$i]);
             $end_a = '</a>';
         }
-        o(escapeHTML($st));
+        if (ref $st) {
+            $st = pandoc2html_inline $st;
+        } else {
+            $st = escapeHTML($st);
+        }
+        o($st);
         o($end_a);
         o('</td>');
         o($nextcell);
Signature · 7 lines
2.11.0


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

PATCH 6/7 docs/parse-support-md: Allow definition lists for features

In reply to Ian Jackson

Now, as well as a `code block', with
| Something: some status
we tolerate a definition list which in pandoc terms looks like this
|Term
|: Definition

This ought not usually be be used for features but it will be useful for linking to the release notes, because markup is not allowed in code blocks but is in definitions.

---
 docs/parse-support-md | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
docs/parse-support-md +27 -0
index 16dd99f063..84f0a96a0f 100755
@@ -191,6 +191,33 @@ sub ri_CodeBlock {
     }
 }
 
+sub ri_DefinitionList {
+    my ($c) = @_;
+    foreach my $defent (@$c) {
+        my ($term, $defns) = @$defent;
+        my $descr =
+            join ' ',
+            map { $_->{c} }
+            grep { $_->{t} eq 'Str' }
+            @$term;
+        push @insections,
+            {
+             Key => descr2key($descr),
+             Headline => $term,
+            };
+        die "multiple definitions in definition list definition"
+            if @$defns > 1;
+        my $defn = $defns->[0];
+        die "multiple paras in definition list definition"
+            if @$defn > 1;
+        my $defnp = $defn->[0];
+        die "only understand plain definition not $defnp->{t} ?"
+            unless $defnp->{t} eq 'Plain';
+        parse_feature_entry $defnp->{c};
+        pop @insections;
+    }
+}
+
 sub process_unknown {
     my ($c, $e) = @_;
     $had_unknown = Dumper($e);
Signature · 7 lines
2.11.0


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

PATCH 7/7 SUPPORT.md: Turn release notes link into a proper link.

In reply to Ian Jackson
---
 SUPPORT.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
SUPPORT.md +3 -1
index 42577d0243..291e149503 100644
@@ -13,7 +13,9 @@ for the definitions of the support status levels etc.
     Initial-Release: n/a
     Supported-Until: TBD
     Security-Support-Until: Unreleased - not yet security-supported
-    Release-Notes: <a href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes">RN</a>
+
+Release Notes
+: <a href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes">RN</a>
 
 # Feature Support
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on the v1 series
#8 lore raw
In reply to Ian Jackson
Quoted 17 lines · Ian Jackson

An example of the results of this can be seen here:
http://xenbits.xenproject.org/people/iwj/2018/support-matrix-example-4/t.html
http://xenbits.xenproject.org/people/iwj/2018/support-matrix-example-4/SUPPORT.html#release-support

The only part of this that needs to be backported is the part to change the syntax in SUPPORT.md, but we do need to wait for the other changes to hit master.

Ian Jackson (7):
docs/parse-support-md: More complete example runes docs/parse-support-md: Adjust some (commented-out) debugging docs/parse-support-md: Break out descr2key docs/parse-support-md: pandoc2html_inline: print failing json docs/parse-support-md: Correct handling of Status docs/parse-support-md: Allow definition lists for features SUPPORT.md: Turn release notes link into a proper link.

Quoted 3 lines
 SUPPORT.md            |  4 ++-
 docs/parse-support-md | 79 ++++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 62 insertions(+), 21 deletions(-)

For the series:

Juergen

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

#9 lore raw

Juergen Gross writes ("Re: [PATCH 0/7] docs: Fix support matrix release notes link"):

Quoted 4 lines · Ian Jackson
Quoted 3 lines

The only part of this that needs to be backported is the part to change the syntax in SUPPORT.md, but we do need to wait for the other changes to hit master.

...

Quoted 2 lines

For the series:

Thanks. Not sure exactly whose acks I need but I think it is uncontroversial. So I have pushed this.

Ian.

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