<!DOCTYPE html>
<html>
  <head>
    <title><%= $title %></title>
    %= stylesheet '/css/prettify-mojo.css'
    %= javascript '/js/prettify.js'
    %= stylesheet begin
      a { color: inherit }
      a:hover { color: #2a2a2a }
      a img { border: 0 }
      body {
        background-color: #f5f6f8;
        color: #445555;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5;
        margin: 0;
      }
      h1, h2, h3 {
        color: #2a2a2a;
        font-size: 1.5em;
        margin: 0;
      }
      h1 a, h2 a, h3 a { text-decoration: none }
      pre {
        background-color: #eee;
        background: url(<%= url_for '/mojolicious-pinstripe.gif' %>);
        -moz-border-radius: 5px;
        border-radius: 5px;
        color: #eee;
        font: 0.8em Consolas, Menlo, Monaco, Courier, monospace;
        text-align: left;
        text-shadow: #333 0 1px 0;
        padding-bottom: 1.5em;
        padding-top: 1.5em;
        white-space: pre-wrap;
      }
      #footer {
        padding-top: 1em;
        text-align: center;
      }
      #perldoc {
        background-color: #fff;
        -moz-border-radius-bottomleft: 5px;
        border-bottom-left-radius: 5px;
        -moz-border-radius-bottomright: 5px;
        border-bottom-right-radius: 5px;
        -moz-box-shadow: 0px 0px 2px #ccc;
        -webkit-box-shadow: 0px 0px 2px #ccc;
        box-shadow: 0px 0px 2px #ccc;
        margin-left: 5em;
        margin-right: 5em;
        padding: 3em;
        padding-top: 7em;
      }
      #perldoc > ul:first-of-type a { text-decoration: none }
      #wrapperlicious {
        max-width: 1000px;
        margin: 0 auto;
      }
    % end
  </head>
  <body onload="prettyPrint()">
    %= include inline => $Mojolicious::Controller::MOJOBAR
    % my $link = begin
      %= link_to shift, shift, class => "mojoscroll"
    % end
    <div id="wrapperlicious">
      <div id="perldoc">
        <h1><a id="toc">TABLE OF CONTENTS</a></h1>
        <ul>
          % for my $section (@$sections) {
            <li>
              %= $link->(splice @$section, 0, 2)
              % if (@$section) {
                <ul>
                  % while (@$section) {
                    <li>
                      %= $link->(splice @$section, 0, 2)
                    </li>
                  % }
                </ul>
              % }
            </li>
          % }
        </ul>
        %= content_for 'perldoc'
      </div>
    </div>
    <div id="footer">
      %= link_to 'http://mojolicio.us' => begin
        %= image '/mojolicious-black.png', alt => 'Mojolicious logo'
      % end
    </div>
  </body>
</html>
