common html initialisation function
[sheet.git] / source.plp
index de3ad544c6d3067dffe9319ef5b0fa83c7a2a9e8..cdd40a1c72e86cfd30d7d726f749acfe0f60ebfa 100644 (file)
@@ -1,28 +1,22 @@
 <(common.inc.plp)><:
-       our $VERSION = 'v1.0';
 
-       my $source = $ENV{PATH_INFO};
-       $source =~ s{^/}{};
+my $source = $ENV{PATH_INFO};
+$source =~ s{^/}{};
 
-:><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
+Html({
+       title => "$source source code",
+       version => 'v1.0',
+       description => !$source ? 'Index of source files for this site.' : [
+               "Source code of local $source file,",
+               "with syntax highlighted and references linked."
+       ],
+       keywords => [qw'
+               sheet cheat source code perl plp html agpl
+       '],
+       stylesheet => [qw'light dark mono red'],
+});
 
-<head>
-<meta http-equiv="content-type" content="<:= $header{content_type} :>">
-<title><:= $source :> source code</title>
-<meta name="description" content="<:=
-       $source ? "Source code of local $source file"
-                 . ", with syntax highlighted and references linked."
-               : 'Index of source files for this site.'
-:>">
-<meta name="keywords" content="sheet, cheat, source, code, perl, plp, html, agpl">
-<:= stylesheet(qw'light dark mono red') :>
-<link rel="icon" type="image/png" href="/clip.png">
-</head>
-
-<body id="source">
-<:
+print "\n";
 
 if (not $source) {
        print "<h1>Source files</h1>";
@@ -84,16 +78,7 @@ else {
        else {
                print "<pre>\n", EscapeHTML(ReadFile($source)), "</pre>\n";
        }
+
+       print "\n";
 }
-:>
-<p class="footer">
-       <a href="/" rel="home">sheet.shiar.nl</a>/source.<a href="/source/source.plp"
-        rel="code" title="Written in Perl">plp</a>
-       <a href="http://git.shiar.nl/sheet.git/history/HEAD:/source.plp"
-        rel="vcs-git" title="Git repository"><:= $VERSION :></a>
-       created by <a href="http://shiar.nl/" rel="author">Shiar</a> •
-       <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html" rel="copyright"
-        title="Licensed under the GNU Affero General Public License, version 3">AGPLv3</a>
-</p>
 
-</html>