sample: html wrapper for unicode text file
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 17 May 2017 09:45:52 +0000 (11:45 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 29 May 2017 17:29:34 +0000 (19:29 +0200)
Makefile
sample.plp [new file with mode: 0644]

index 64e034bc5eab3c5e3cbb2a34b4b1215e6d937037..0dbde306c6d4436f3a083fe24f6242eba377bcf2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 all: sitemap.xml data/digraphs.inc.pl data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl
 more: all data/digraphs-xorg.inc.pl
 
 all: sitemap.xml data/digraphs.inc.pl data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl
 more: all data/digraphs-xorg.inc.pl
 
-download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInfo.txt data/browser/caniuse data/browser/usage-wm.tsv data/xcolors
+download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInfo.txt data/browser/caniuse data/browser/usage-wm.tsv data/xcolors data/unicode-sampler
 .PHONY: download
 
 sitemap.xml: tools/mksitemap
 .PHONY: download
 
 sitemap.xml: tools/mksitemap
@@ -40,6 +40,11 @@ data/unicode-char.inc.pl: tools/mkcharinfo data/digraphs-rfc.inc.pl data/digraph
 data/font/%.inc.pl: tools/mkttfinfo data/font/%.ttf
        $< $(word 2,$^) $@ || true
 
 data/font/%.inc.pl: tools/mkttfinfo data/font/%.ttf
        $< $(word 2,$^) $@ || true
 
+data/unicode-sampler:
+       @echo git pull or clone $@
+       @[ -r $@/.git ] && cd $@ && git pull --ff-only || true
+       @[ -e $@ ] || git clone git://git.shiar.nl/unicode-sampler $@
+
 data/xcolors/themes: data/xcolors
 data/xcolors:
        @echo git pull or clone $@
 data/xcolors/themes: data/xcolors
 data/xcolors:
        @echo git pull or clone $@
diff --git a/sample.plp b/sample.plp
new file mode 100644 (file)
index 0000000..7f8b636
--- /dev/null
@@ -0,0 +1,20 @@
+<(common.inc.plp)><:
+
+Html({
+       title => "unicode sampler",
+       version => '2.0',
+       stylesheet => [qw'light dark mono red'],
+});
+
+open my $source, '<', 'data/unicode-sampler/unicode.txt'
+       or die "Could not open text: $!\n";
+
+my $title = readline $source;
+my $hr = readline $source;
+say "<h1>$title</h1>";
+
+say '<pre>';
+while (my $p = readline $source) {
+       print EscapeHTML($p);
+}
+say "</pre>\n";