perl: wrap code blocks on mobile screens
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 8 Jul 2024 17:01:18 +0000 (19:01 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 6 Aug 2024 00:05:55 +0000 (02:05 +0200)
base.css
common.inc.plp
perl.inc.pl

index 405b282ab87c078260f6e87c6ea59057ff5aa333..e7d5fddcbacbb8901964bea5794eca0bdc98c13c 100644 (file)
--- a/base.css
+++ b/base.css
@@ -153,11 +153,17 @@ dl > dd {
 }
 @media (max-width: 42em) {
        .section dl {
 }
 @media (max-width: 42em) {
        .section dl {
-               grid: auto-flow / minmax(8em, 1fr) minmax(20em, 1fr);
+               grid: auto-flow / minmax(8em, 1fr) minmax(10em, 3fr);
        }
        dl > dd {
                margin-bottom: 1ex; /* distinguish rows more as dts can wrap */
        }
        }
        dl > dd {
                margin-bottom: 1ex; /* distinguish rows more as dts can wrap */
        }
+       dd small {
+               display: inline-block;
+       }
+       dd code {
+               white-space: normal;
+       }
 }
 
 /* "keyboard" (list of keys) */
 }
 
 /* "keyboard" (list of keys) */
index a634733cba704de18de8e56605a78a796f8109c9..a9d5875920da8565c8b6c6ce9c0ce46119f2b16d 100644 (file)
@@ -76,7 +76,7 @@ sub stylesheet {
 
        return map { sprintf(
                '<link rel="%s" type="text/css" media="all" href="%s" title="%s">',
 
        return map { sprintf(
                '<link rel="%s" type="text/css" media="all" href="%s" title="%s">',
-               $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.18", $_
+               $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.19", $_
        ) } @avail;
 }
 
        ) } @avail;
 }
 
index ee7aaad5e6988154fe32f0ba40051381534339b4..1291ceb12a1ae1ec9b543be0484421cb6a024c16 100644 (file)
@@ -76,7 +76,7 @@ my $wbr = "\N{ZERO WIDTH SPACE}";
                ],
                modules => [
                        [bignum => 'transparent big number support', 'length 1e100 == 101'],
                ],
                modules => [
                        [bignum => 'transparent big number support', 'length 1e100 == 101'],
-                       [if => 'conditional module inclusion', 'no if $] >= 5.022, "warnings", "redundant"'],
+                       [if => 'conditional module inclusion', 'no if $] >= 5.022, "warnings", "redundant"'],
                        [sort => 'override sort() algorithm', {dropped => v5.28, eg => 'sort::current eq "stable"'}],
                        [Digest => 'calculate various message digests (data hashes)', '$hash = sha256_hex($data)'],
                        [Encode => 'character set conversion', 'encode("utf8", decode("iso-8859-1", $octets))'],
                        [sort => 'override sort() algorithm', {dropped => v5.28, eg => 'sort::current eq "stable"'}],
                        [Digest => 'calculate various message digests (data hashes)', '$hash = sha256_hex($data)'],
                        [Encode => 'character set conversion', 'encode("utf8", decode("iso-8859-1", $octets))'],
@@ -86,7 +86,7 @@ my $wbr = "\N{ZERO WIDTH SPACE}";
                        ['Memoize' => 'remember function results, trading space for time', 'memoize "stat"'],
                        ['MIME::Base64' => 'base64 encoded strings as in email attachments'],
                        ['Test::More' => 'modern framework for unit testing', 'is $got, $expected'],
                        ['Memoize' => 'remember function results, trading space for time', 'memoize "stat"'],
                        ['MIME::Base64' => 'base64 encoded strings as in email attachments'],
                        ['Test::More' => 'modern framework for unit testing', 'is $got, $expected'],
-                       ['Time::HiRes' => 'high resolution timers', '$μs = [gettimeofday]; sleep .1;'.$wbr.' $elapsed = tv_interval $μs'],
+                       ['Time::HiRes' => 'high resolution timers', '$μs = [gettimeofday]; sleep .1;'.$wbr.' $elapsed = tv_interval $μs'],
                ],
                release => '2002-07-18',
                distro => {
                ],
                release => '2002-07-18',
                distro => {
@@ -122,9 +122,9 @@ my $wbr = "\N{ZERO WIDTH SPACE}";
                        ['<code>state</code>', 'persistent <code>my</code> variables (scalars only until <a href="#state_ext">5.28</a>)', {feature => 'state'}],
                ],
                modules => [
                        ['<code>state</code>', 'persistent <code>my</code> variables (scalars only until <a href="#state_ext">5.28</a>)', {feature => 'state'}],
                ],
                modules => [
-                       [autodie => 'replace builtin functions to throw exceptions instead of returning failure', 'eval {open ...} or $@->matches("open") || die'],
+                       [autodie => 'replace builtin functions to throw exceptions instead of returning failure', 'eval {open ...} or $@->matches("open") || die'],
                        # overloading
                        # overloading
-                       ['IO::Compress::Zip' => 'various file compression standards', 'zip IO::Uncompress::Gunzip->new("test.gz")'.$wbr.' => "recompressed.zip"'],
+                       ['IO::Compress::Zip' => 'various file compression standards', 'zip IO::Uncompress::Gunzip'.$wbr.'->new("test.gz")'.$wbr.' => "recompressed.zip"'],
                        ['Time::Piece' => 'timestamps as objects', 'localtime->year > 1900'],
                        ['File::Fetch' => 'generic data retrieval/download', 'File::Fetch->new(uri => "http://localhost/")'.$wbr.'->fetch(to => \$slurp)'],
                ],
                        ['Time::Piece' => 'timestamps as objects', 'localtime->year > 1900'],
                        ['File::Fetch' => 'generic data retrieval/download', 'File::Fetch->new(uri => "http://localhost/")'.$wbr.'->fetch(to => \$slurp)'],
                ],
@@ -337,7 +337,7 @@ my $wbr = "\N{ZERO WIDTH SPACE}";
        v5.32 => {
                new => [
                        ['<code>isa</code>', 'infix operator to check class instance', {feature => 'isa', experimental => 'isa', stable => v5.36}],
        v5.32 => {
                new => [
                        ['<code>isa</code>', 'infix operator to check class instance', {feature => 'isa', experimental => 'isa', stable => v5.36}],
-                       ['<code>$min &lt; $_ &lt;= $max</code>', 'chained comparison repeats inner part as <code>$min &lt; $_ and $_ &lt;= $max</code>'],
+                       ['<code>$min &lt; $_ &lt;= $max</code>', 'chained comparison repeats inner part as <code>$min &lt; $_ and $_ &lt;= $max</code>'],
                        ['<code>/\p{Name=$var}/</code>', 'match Unicode Name property like <code>\N{}</code> but with interpolation and subpatterns'],
                        [q"<code>open F, '+&gt;&gt;', undef</code>", 'respect append mode on temporary files with mixed access'],
                        ["<code>no feature 'indirect'</code>", 'disable indirect object notation such as <code>new Class</code> instead of <code>Class-&gt;new</code>'],
                        ['<code>/\p{Name=$var}/</code>', 'match Unicode Name property like <code>\N{}</code> but with interpolation and subpatterns'],
                        [q"<code>open F, '+&gt;&gt;', undef</code>", 'respect append mode on temporary files with mixed access'],
                        ["<code>no feature 'indirect'</code>", 'disable indirect object notation such as <code>new Class</code> instead of <code>Class-&gt;new</code>'],
@@ -362,7 +362,7 @@ my $wbr = "\N{ZERO WIDTH SPACE}";
                        ['<code>/{,<i>n</i>}/</code>', 'empty lower bound quantifier is accepted as shorthand for 0'],
                        ['<code>\x{ … }</code>', 'insignificant space within curly braces, also for <code>\b{}</code>, <code>\g{}</code>, <code>\k{}</code>, <code>\N{}</code>, <code>\o{}</code> as well as <code>/{m,n}/</code> quantifiers'],
                        ['<code>0o0</code>', 'octal prefix <code>0o</code> alternative to <code>0…</code> and <code>oct</code>'],
                        ['<code>/{,<i>n</i>}/</code>', 'empty lower bound quantifier is accepted as shorthand for 0'],
                        ['<code>\x{ … }</code>', 'insignificant space within curly braces, also for <code>\b{}</code>, <code>\g{}</code>, <code>\k{}</code>, <code>\N{}</code>, <code>\o{}</code> as well as <code>/{m,n}/</code> quantifiers'],
                        ['<code>0o0</code>', 'octal prefix <code>0o</code> alternative to <code>0…</code> and <code>oct</code>'],
-                       ['<code>re::optimization(qr//)</code>', 'debug regular expression optimization information discovered at compile time'],
+                       ["<code>re::optimization(${wbr}qr//)</code>", 'debug regular expression optimization information discovered at compile time'],
                        ['<code>no feature …</code>', 'disable discouraged practices of <code>bareword_filehandles</code> and <code>multidimensional</code> array emulation'],
                ],
                release => '2021-05-20',
                        ['<code>no feature …</code>', 'disable discouraged practices of <code>bareword_filehandles</code> and <code>multidimensional</code> array emulation'],
                ],
                release => '2021-05-20',
@@ -397,7 +397,7 @@ my $wbr = "\N{ZERO WIDTH SPACE}";
                new => [
                        ['<code>use feature "module_true"</code>', 'default in use 5.37 and up, also <code>no feature "bareword_filehandles"</code>'],
                        ['<code>sub ($var ||=</code> default<code>)</code>', 'assign values when false (or undefined on <code>//=</code>) instead of omitted'],
                new => [
                        ['<code>use feature "module_true"</code>', 'default in use 5.37 and up, also <code>no feature "bareword_filehandles"</code>'],
                        ['<code>sub ($var ||=</code> default<code>)</code>', 'assign values when false (or undefined on <code>//=</code>) instead of omitted'],
-                       ['<code>/(*{ … })/</code>', 'optimistic eval: <code>(?{ … })</code> with regex optimisations enabled'],
+                       ['<code>/(*{ … })/</code>', 'optimistic eval: <code>(?{ … })</code> with regex optimisations enabled'],
                        ['<code>class</code>', "define object classes: packages with <code>field</code> variables and <code>method</code> subroutines", {feature => 'class', experimental => 'class'}],
                        ['<code>${^LAST_<wbr>SUCCESSFUL_<wbr>PATTERN}</code>', 'explicit variable to access the previous match as in <code>s//…/</code>'],
                        ['<code>%{^HOOK}</code>', "perform tasks <code>require__before</code> and <code>require__after</code> when calling <code>require</code>"], # also @INC hook enhancements
                        ['<code>class</code>', "define object classes: packages with <code>field</code> variables and <code>method</code> subroutines", {feature => 'class', experimental => 'class'}],
                        ['<code>${^LAST_<wbr>SUCCESSFUL_<wbr>PATTERN}</code>', 'explicit variable to access the previous match as in <code>s//…/</code>'],
                        ['<code>%{^HOOK}</code>', "perform tasks <code>require__before</code> and <code>require__after</code> when calling <code>require</code>"], # also @INC hook enhancements