docs: Fix support matrix release notes link
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
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
@@ -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
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
@@ -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
PATCH 3/7 docs/parse-support-md: Break out descr2key
In reply to Ian JacksonWe 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
@@ -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
PATCH 4/7 docs/parse-support-md: pandoc2html_inline: print failing json
In reply to Ian JacksonIf 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
@@ -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
PATCH 5/7 docs/parse-support-md: Correct handling of Status
In reply to Ian JacksonIn 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
@@ -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
PATCH 6/7 docs/parse-support-md: Allow definition lists for features
In reply to Ian JacksonNow, 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
@@ -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
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
@@ -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
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-supportThe 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
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:
Acked-by Juergen Gross <[email protected]>
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