App-zen
view release on metacpan or search on metacpan
$ln++;
}
print $output $_->{text},"\n";
}
}
use Data::Dumper;
sub docgen_html {
my $zf = shift;
my $old = select(shift);
print "<!DOCTYPE HTML>\n\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release\@10.7.3/build/style...
print "<script>";
print "window.zen = ";
print JSON::encode_json({
last_modified => $zf->{last_modified},
size => $zf->{size},
});
print "</script>";
print '<div class="container">';
print '<aside class="col foldable narrow">';
if ($input_file && $cmd) {
open(my $fh, '>', $input_file) or die "Could not open file '$input_file' $!";
print $fh $src;
close $fh;
dbg("running: $cmd");
system($cmd);
}
my $relpath = "gen/" . basename($output_file);
if ($output_file =~ m/\.(jpg|png)$/) {
print "<figure>";
print "<img src=\"$relpath\">";
print "</figure>\n";
} elsif ($output_file =~ m/\.(svg)$/) {
my $content = read_file($output_file);
$content =~ s/^\<\?.*+\?\>//;
print "<figure>";
print $content;
print "<figcaption>";
print "<button click=\"export-svg\">download</button>";
use Fcntl qw(:flock);
use POSIX qw( strftime );
use Data::Dumper;
my %mimeTypes = (
html => 'text/html',
css => 'text/css',
js => 'text/javascript',
json => 'application/json',
svg => 'image/svg+xml',
png => 'image/png',
jpeg => 'image/jpeg',
jpg => 'image/jpeg',
gif => 'image/gif',
txt => 'text/plain',
);
sub handle_request {
my ($self, $cgi) = @_;
my $path = $cgi->path_info();
( run in 0.919 second using v1.01-cache-2.11-cpan-df04353d9ac )