Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
/library/*/files.make
/library/*/*.usvg
/library/*/*.coloured.svg
+/library/edited/dice-d6-blue.svg
*.tmp
.tsconfig.*.json
stamp/*
nwtemplates/die-overlay.tera: dice/overlay-template-extractor dice/die.svg
./$< <dice/die.svg >$@.tmp && mv -f $@.tmp $@
+library/edited/dice-d6-blue.svg: dice/extract-image-only dice/die.svg
+ ./$< <dice/die.svg >$@.tmp && mv -f $@.tmp $@
+
#---------- examples ----------
EXAMPLE_BUNDLE_INPUT_DEPS := $(shell \
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+
+use strict;
+
+use XML::LibXML;
+use XML::LibXML::XPathContext;
+
+use Data::Dumper;
+
+my $dom = XML::LibXML->load_xml(IO => \*STDIN) or die;
+
+print "<!--made by dice/extract-image-only-->\n" or die $!;
+
+my $nodes = $dom->findnodes('//*[@inkscape:label]');
+foreach my $node (@$nodes) {
+ my $l = $node->getAttribute('inkscape:label');
+ next unless $l =~ m/^time|^text/;
+ my $parent = $node->parentNode;
+ $parent->removeChild($node);
+}
+
+print $dom->toString or die $!;