From: Ian Jackson Date: Fri, 15 Apr 2022 22:40:31 +0000 (+0100) Subject: die: Prepare for extracting text template too (2) X-Git-Tag: otter-1.1.0~548 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5fdb694dd6364c9cea362de11022e69a6ecea2ee;p=otter.git die: Prepare for extracting text template too (2) Bracket our cooldown output all together. I did it the other way because I had forgotten that the output order is controlled by the script, not the input. Signed-off-by: Ian Jackson --- diff --git a/dice/overlay-template-extractor b/dice/overlay-template-extractor index 3ca02b8f..168cf324 100755 --- a/dice/overlay-template-extractor +++ b/dice/overlay-template-extractor @@ -15,7 +15,9 @@ my $xpc = XML::LibXML::XPathContext->new($dom) or die; our ($label, $node); -print "\n" or die $!; +sub p { print @_ or die $!; } + +p "\n"; sub process_node ($$) { my $fn; @@ -24,10 +26,7 @@ sub process_node ($$) { die "$label ?" unless @$nodes == 1; $node = $nodes->[0]; $fn->($node); - print - "{% if cooldown_active %}", - $node->toString, - "{% endif %}\n" or die $!; + p $node->toString, "\n"; } our $nom_radius; @@ -56,6 +55,7 @@ sub filter_circle () { $node->setAttribute('r', "{{radius}}"); } +p "{% if cooldown_active %}\n"; process_node('timeblack', sub { $nom_radius = $node->getAttribute('r'); filter_circle(); @@ -69,3 +69,4 @@ process_node('timegrey', sub { $node->setAttribute("data-$d", "{{$d}}"); } }); +p "{% endif %}\n";