X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/84f0630eace132ded7af839105d7e2d096eba5ad..108d13f833e9daeff4ea1552e2e1bee1e0ed8c22:/source.plp diff --git a/source.plp b/source.plp index 418a2c1..38af1fa 100644 --- a/source.plp +++ b/source.plp @@ -1,7 +1,6 @@ <(common.inc.plp)><: -my $source = $ENV{PATH_INFO}; -$source =~ s{^/}{}; +my $source = $Request; if ($source =~ s{(?<=\Q.inc.pl\E)/jsonp?$}{} and -r $source) { # convert perl include to json construct @@ -28,7 +27,7 @@ if ($source =~ s{(?<=\Q.inc.pl\E)/jsonp?$}{} and -r $source) { Html({ title => "$source source code", - version => 'v1.1', + version => '1.1', description => !$source ? 'Index of source files for this site.' : [ "Source code of the $source file at this site,", "with syntax highlighted and references linked." @@ -39,21 +38,21 @@ Html({ stylesheet => [qw'light dark mono red'], }); -print "\n"; +say ''; if (not $source) { print "
Project code distributed under the AGPL. Please contribute back.
"; - print '\n"; + say ''; } else { - print "'; foreach (@$parsed) { my ($type, $contents) = @{$_}; $contents = Encode::decode_utf8($contents); @@ -106,14 +105,14 @@ else { print Text::VimColor::_xml_escape($contents); print "$tag>" if $tag; } - print "\n"; + say '
\n"; + say ''; } - print "\n"; + say ''; }'; print EscapeHTML(Encode::decode_utf8(ReadFile($source))); - print "\n"; + say '