Snippets

sironekotoro Perl入学式 2018 in 東京 第2回 (20180526) で使ったmojoliciousとremark.jsのスライドビューア

Created by sironekotoro last modified
#!/usr/bin/env perl
use Mojolicious::Lite;

# Documentation browser under "/perldoc"
plugin 'PODRenderer';

get '/' => sub {
    my $c = shift;
    $c->render( template => 'index' );
};

app->start;
__DATA__

@@ index.html.ep
% layout 'default';
% title 'Perl入学式 2018 第2回';

<script src='https://gnab.github.io/remark/downloads/remark-latest.min.js' type='text/javascript'>
</script>

<script type='text/javascript'>
  var slideshow = remark.create({sourceUrl: 'https://cdn.rawgit.com/sironekotoro/workshop-2018/master/2nd/slide.md'});
</script>


@@ layouts/default.html.ep
<!DOCTYPE html>
<html>
<head>
  <title><%= title %></title>

  <!-- styleタグ内は https://github.com/gnab/remark 参考 -->
  <style>
    @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
    @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
    @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);

    body { font-family: 'Droid Serif'; }
    h1, h2, h3 {
      font-family: 'Yanone Kaffeesatz';
      font-weight: normal;
    }
    .remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
  </style>

</head>

<body>
<%= content %>
</body>

</html>

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.