App-mookview

 view release on metacpan or  search on metacpan

lib/App/mookview.pm  view on Meta::CPAN

        }
    }
    $content = $self->add_markdown_to_html($content, $stock, $page);
    my $html = $self->{xslate}->render('preview.tx', {
        content => mark_raw($content),
        filename => $self->{file_path}->basename,
        length => $length
    });
    $html = encode_utf8($html);
    return [200, [
        'Content-Type' => 'text/html; charset=utf8',
        'Content-Length' => length $html,
    ], [ $html ] ];
}

sub filter_markdown {
    my ($self, $markdown) = @_;
    $markdown =~ s!^```.*?\n(.+?)\n```.*?$!
        my $code = '';
        $code .= "    $_\n" for split /\n/, $1;
        $code;

share/static/css/screen.css  view on Meta::CPAN

@charset "UTF-8";
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,

share/templates/preview.tx  view on Meta::CPAN

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>(<: $length :>) <: $filename :></title>
    <link href="/css/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <div id="wrapper">
      <div id="content"><: $content :></div>
      <div id="footer"><: $length :> chars</div>
    </div>
  </body>
</html>



( run in 0.256 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )