latin: single line per letter in html output
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 26 Mar 2017 18:44:14 +0000 (20:44 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 26 Mar 2017 18:44:14 +0000 (20:44 +0200)
Same results but with readable source.

latin.plp
writing-latn.inc.pl

index 406cfa3de8f6098da9d9323f8e885c085392de2d..ed68caeaf2e6940cd5ccbf33ec2f9463485c6e12 100644 (file)
--- a/latin.plp
+++ b/latin.plp
@@ -1,4 +1,5 @@
 <(common.inc.plp)><:
+use 5.014;
 
 Html({
        title => 'latin alphabet cheat sheet',
@@ -43,7 +44,7 @@ or <span title="fuck yeah!">'mercan</span>) letters A–Z.
 Also see <a href="/writing">related alphabets</a>
 and <a href="/unicode">common chars</a>.</p>
 
-<div class="-diinfo">
+<div>
 
 <:
 my @table = do 'writing-latn.inc.pl';
@@ -51,10 +52,11 @@ if ($! or $@) {
        printf "<p class=error>Table data not found: <em>%s</em>.</p>\n", $@ || $!;
 }
 else {
-       print '<table class="glyphs">';
-       print ref $_ ne 'ARRAY' ? "<tr><th>$_" : map {/^<td/ ? $_ : "<td>$_"} @$_ for @table;
-       print "</table>\n\n";
+       say '<table class="glyphs">';
+       print ref $_ ne 'ARRAY' ? "<tr><th>$_\n" : map {/^<td/ ? $_ : "\t<td>$_\n"} @$_
+               for @table;
+       say "</table>\n";
 }
 
-print "</div>\n";
+:></div>
 
index 8cace931f5add7f2855a4f0902c2bb7049b7be7f..be639c65c71afbbfab25aa724e186370dc17fcd8 100644 (file)
@@ -41,7 +41,7 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
 })],
 'Maritime flags' => [
        # International Code of Signals, SVG fills
-       map { '<svg width="20" height="20" viewBox="0 0 30 30">'.$_.'</svg>' }
+       map { '<svg width="20" height="20" viewBox="0 0 30 30">'.s/\n?\t+//gr.'</svg>' }
        split /\n\n/, qq{
                <path fill="$C{blue}" d="M0,0 h30 l-7.5,15 7.5,15 h-30 z"/>
                <path fill="white" d="M0,0 h15 v30 h-15"/>
@@ -83,7 +83,6 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
 
                <path fill="white" d="M0,0 h30v30 h-30z"/>
                <path fill="$C{blue}" d="M4,0h22l-11,11 M4,30h22l-11,-11 M0,4v22l11,-11 M30,4v22l-11,-11"/>
-               <!--path fill="$C{blue}" d="M3,0h24l-12,12 M3,30h24l-12,-12 M0,3v24l12,-12 M30,3v24l-12,-12"/-->
 
                <path fill="white" d="M0,0 h30v30 h-30z"/>
                <path fill="$C{blue}" d="