X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/effd000ff281f2187bf653b6e1c6aa0fc796c5f9..facfe1b3424fb20fe469926f9e8dc77195518f1d:/source.plp?ds=sidebyside diff --git a/source.plp b/source.plp index e645cd2..358bf84 100644 --- a/source.plp +++ b/source.plp @@ -43,13 +43,18 @@ Html({ say ''; -if (not $source) { - print "
Project code distributed under the AGPL. Please contribute back.
"; say ''; + print ReadFile($cachefile); + say ''; + exit; + } + open my $cache, '>', $cachefile + or Alert("Could not save cache", "Opening $cachefile failed: $!");; + if (my $hl = eval { $size < 32_768 or die 'large files take too long to parse'; require Text::VimColor; @@ -89,6 +104,7 @@ else { Statement => 'strong', Error => 'em', Todo => 'em', + PreProc => 'strong', ); say '
'; @@ -110,6 +126,7 @@ else { $line = qq(<$tag class="sy-\l$type">$line$tag>) if $tag; print $line; + print {$cache} $line if $cache; } say ''; }