diff options
author | John Ankarström <john@ankarstrom.se> | 2021-05-06 21:58:34 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-05-06 21:58:34 +0200 |
commit | c690c55e707ee7fd1e5ad4592fec490f7fbd3304 (patch) | |
tree | 814df6286f760abff249bd9f0a32489b91fe80e2 | |
parent | df484fd9b6640639c3a6098814b41628d02e5d54 (diff) | |
download | perlisdead-c690c55e707ee7fd1e5ad4592fec490f7fbd3304.tar.gz |
Various changes
-rw-r--r-- | gen.pl | 32 | ||||
-rw-r--r-- | src/index.html | 124 | ||||
-rw-r--r-- | src/style.css | 100 |
3 files changed, 200 insertions, 56 deletions
@@ -2,24 +2,36 @@ # gen.pl -- generate static files for perlisdead.org -package App::PerlIsDead; -our $VERSION = '0.1'; +use 5.010; use strict; use warnings; use experimental 'switch'; + use File::Copy; use FindBin '$Bin'; use Getopt::Std; +# Parse command-line options + my %opt; $Getopt::Std::STANDARD_HELP_VERSION = 1; getopts('d', \%opt); +sub main::HELP_MESSAGE { + print <<HELP; +usage: $0 [-d] + -d enable debug messages +HELP +} +sub main::VERSION_MESSAGE {} + # Change directory to script path + chdir $Bin; # Generate index.html + mkdir 'out' if ! -d 'out'; open my $src, '<', 'src/index.html' or die "Could not open < src/index.html: $!"; open my $out, '>', 'out/index.html.tmp' or die "Could not open > out/index.html.tmp: $!"; @@ -59,7 +71,7 @@ for (<$src>) { select STDOUT; warn $@ if $@; } - # I guess you could just shell out instead... + # I guess you *could* just run the script in a separate process... } default { print $out $_; @@ -69,9 +81,11 @@ close $out; close $src; # Rename temporary file + move 'out/index.html.tmp' => 'out/index.html'; # Copy modified static files + opendir $src, 'src' or die "Could not open directory src: $!"; opendir $out, 'out' or die "Could not open directory src: $!"; my %src = map { ($_, (stat "src/$_")[9]||0) } grep { not /^\./ or /^index\.html$/ } readdir $src; @@ -86,15 +100,3 @@ closedir $out; closedir $src; print STDERR "DONE\n" if $opt{d}; - -# Definitions - -sub main::HELP_MESSAGE { - print <<HELP; -usage: $0 [-d] - -d enable debug messages -HELP -} -sub main::VERSION_MESSAGE { - print "App::PerlIsDead version $VERSION\n"; -} diff --git a/src/index.html b/src/index.html index 36bc592..2f1aa9d 100644 --- a/src/index.html +++ b/src/index.html @@ -2,13 +2,20 @@ <html lang="en"> <head> <meta charset="utf-8"/> -<title>Perl is Dead</title> +<title>Perl Is Dead</title> <link rel="stylesheet" type="text/css" href="style.css"/> <meta name="description" content=""Perl is dead" is an urban legend and conspiracy theory alleging that famous programming language Perl, created by Larry Wall, died on 19 July 2000 and was secretly replaced by a whitespace-sensitive look-alike."/> </head> <body> -<h1 id="title">Perl is Dead<span style="color: #ccc;">?</span></h1> +<div id="header"> +<h1 id="title"> Perl Is Dead<span style="color: #ccc;">?</span></h1> +</div> + +<table> + +<tr id="row1"> +<td> <p class="intro"> <b>"Perl is dead"</b> is an urban legend and conspiracy theory alleging that famous programming language Perl, created by Larry Wall, died @@ -20,17 +27,11 @@ speeches and Perl book covers. Clue-hunting proved infectious, and within a few weeks had become an international phenomenon. <cite>(paraphrased from <a href="https://en.wikipedia.org/wiki/Paul_is_dead">Wikipedia</a>…)</cite> -<div style="float: right; border: 1px dashed #ccc; padding: 0 1em; margin: 1em -210px 1em 1em;"> -<pre> -.run benchmark -</pre> -</div> - <p> <b>Jokes aside, Perl is alive and well.</b> -It is an excellent choice for new applications, and -it has – by far – the fastest startup time among -all its competitors, as you can see in the figure to the right. +It is an excellent choice for new applications. +As you can see on the right, it has the fastest startup time <em>by +far</em> among its competitors. Every millisecond counts if you're building a command-line utility. <p> @@ -38,36 +39,97 @@ Every millisecond counts if you're building a command-line utility. into the 2020s</b>. Below is a summary of the recent activity of various Perl forums as of .eval print scalar localtime, ".\n"; +</td> -<div class="box" id="p5p" style="margin-left: -100px; width: 460px;"> -<h2>Latest messages on the <a href="https://lists.perl.org/list/perl5-porters.html">perl5-porters</a> mailing list</h2> +<td> +<pre> +.run benchmark +</pre> +</td> + +</tr> + +<tr class="heading-row"> +<td class="heading-cell" colspan="2"> +<h2 class="heading" id="community">Overview of the Perl community</h2> +</td> +</tr> + +<tr> + +<td id="p5p"> +<h3>Latest messages on the <a href="https://lists.perl.org/list/perl5-porters.html">perl5-porters</a> list</h3> .run p5p -</div> +</td> -<div class="box" id="blogs"> -<h2>Latest articles on <a href="http://blogs.perl.org">blogs.perl.org</a></h2> +<td id="blogs"> +<h3>Latest articles on <a href="http://blogs.perl.org">blogs.perl.org</a></h3> .run blogs -</div> +</td> -<div class="box" id="reddit"> -<h2>Latest posts on the <a href="https://reddit.com/r/perl">/r/perl</a> subreddit</h2> +</tr> +<tr> + +<td id="perlmonks"> +<h3>Latest nodes on <a href="https://www.perlmonks.org">PerlMonks</a></h3> +.run perlmonks +</td> + +<td id="reddit"> +<h3>Latest posts on the <a href="https://reddit.com/r/perl">/r/perl</a> subreddit</h3> .run reddit -</div> +</td> -<div class="box" id="irc"> -<h2>Latest activity on the <a href="https://kiwiirc.com/nextclient/irc.freenode.net/#perl">#perl</a> IRC channel</h2> +</tr> +<tr> + +<td id="cpan"> +<h3>Latest uploads to <a href="https://metacpan.org">CPAN</a></h3> +.run cpan +</td> + +<td id="irc"> +<h3>Recent activity on the <a href="https://kiwiirc.com/nextclient/irc.freenode.net/#perl">#perl</a> IRC channel</h3> .run irc -</div> +</td> -<div class="box" id="perlmonks"> -<h2>Latest nodes on <a href="https://www.perlmonks.org">PerlMonks</a></h2> -.run perlmonks -</div> +</tr> -<div class="box" id="cpan"> -<h2>Latest uploads to <a href="https://metacpan.org">CPAN</a></h2> -.run cpan -</div> +<!-- +<tr class="heading-row"> +<td class="heading-cell" colspan="2"> +<h2 class="heading" id="learn">Learn more</h2> +</td> +</tr> + +<tr> +<td colspan="2"> +<ul style="width: 60%; margin: 0 auto;"> +<li>Basic introduction: +<ul> +<li><a href="https://perldoc.perl.org/perlintro">perlintro – a brief introduction and overview of Perl</a> +<li><a href="https://qntm.org/perl_en">Learn Perl in about 2 hours 30 minutes</a> +</ul> +<li>Further education: +<ul> +<li><a href="https://perldoc.perl.org/perl#Tutorials">List of tutorial man pages</a> +<li><a href="https://www.cpan.org/modules/INSTALL.html">How to install CPAN modules</a> +</ul> +</ul> +</td> +</tr> +--> + +<tr> +<td colspan="2"> +<p id="footer"> +Created and maintained by <a href="http://john.ankarstrom.se/">John Ankarström</a>, a.k.a. johnaj. +<br/>Last updated on +.eval print scalar localtime, ".\n"; +</td> +</tr> + +</table> </body> </html> diff --git a/src/style.css b/src/style.css index c150661..74e0a75 100644 --- a/src/style.css +++ b/src/style.css @@ -1,8 +1,10 @@ body { font: 16px/1.4 Arial, Helvetica, sans-serif; - width: 600px; - margin: 0 auto; - padding: 0 1em; + min-width: 800px; + max-width: 1300px; + margin: 0 auto 1em auto; + background: #fff; + color: #111; } h1, h2, h3, h4, h5, h6 { @@ -13,15 +15,48 @@ pre, code, tt { font-size: 14px; } +td pre { + margin-top: 0; +} + h1#title { text-align: center; + border-top: 8px solid #d00; + padding-top: 0.5em; + font-size: 2.4em; + margin-top: 0; + margin-bottom: 1em; +} + +h2.heading { + font-size: 1.5em; + text-align: center; + border-top: 6px solid #5F5ABF; + padding-top: 0.5em; + margin-top: 2em; + margin-bottom: 1.3em; +} + +p#footer { + text-align: center; + font-size: smaller; + color: #666; + border-top: 1px solid #ccc; + padding-top: 0.6em; +} + +p { + text-align: justify; + hyphens: auto; + -o-hyphens: auto; + -webkit-hyphens: auto; + -moz-hyphens: auto; } p.intro { font-size: 18px; color: #d00; margin: 0 1.8em; - text-align: justify; } p.intro cite { font-size: 14px; @@ -30,18 +65,63 @@ p.intro cite { font-style: normal; } -.box { - border: 1px dashed #ccc; - padding: 0 1em; - margin: 1em 0; +table { + border-collapse: collapse; +} + +td { + padding: 0em 2em; + width: 50%; + vertical-align: top; +} + +td.heading-cell { + padding: 0; +} + +tr + tr { + //border-top: 1px dashed #ccc; +} + +tr.heading-row, tr.heading-row + tr { + border-top: 0; } -.box h2 { + +td + td { + //border-left: 1px dashed #ccc; +} + +td h3 { + width: 100%; font-size: 18px; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal; } .entry .date, .entry .from { - font-size: smaller; + font-size: 12px; +} +.entry .subject { + font-size: 14px; } .entry { margin-bottom: 1em; } + +#p5p h3 { border-bottom: 3px solid #34A630; } +#p5p a { color: #2F722F; } + +#blogs h3 { border-bottom: 3px solid #3075A6; } +#blogs a { color: #253174; } + +#reddit h3 { border-bottom: 3px solid #33CBCD; } +#reddit a { color: #177A7C; } + +#perlmonks h3 { border-bottom: 3px solid #000066; } +#perlmonks a { color: #111169; } + +#cpan h3 { border-bottom: 3px solid #CC3333; } +#cpan a { color: #A33C3C; } + +#irc h3 { border-bottom: 3px solid #CCC433; } +#irc a { color: #8F8A2D; } |