[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] docs/parse-support-md: Break out descr2key
commit f0a773939727efb0a0553b1909ed6571b8092f69 Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> AuthorDate: Mon Dec 3 12:03:19 2018 +0000 Commit: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> CommitDate: Mon Dec 10 15:13:07 2018 +0000 docs/parse-support-md: Break out descr2key We are going to want to reuse this. No functional change. Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Acked-by: Juergen Gross <jgross@xxxxxxxx> --- docs/parse-support-md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/parse-support-md b/docs/parse-support-md index bbe4d045e1..e2d0187dd1 100755 --- a/docs/parse-support-md +++ b/docs/parse-support-md @@ -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 }], }; } -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |