<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>{{ title }}</title>
  <script src="{{ resource_path }}/jquery.js"></script>
  <script>
    $(function () {
      var math_spans = $('span[hasMath="true"]');
      if (math_spans.length > 0) {
        load_css('{{ resource_path }}/katex/katex.min.css');
        load_js('{{ resource_path }}/katex/katex.min.js', function () {
          math_spans.each(function () {
            katex.render($(this).text(), this, { throwOnError: false });
          });
        });
      }
    });

    function load_css(url) {
      $('<link>')
        .appendTo('head')
        .attr({
          type: 'text/css',
          rel: 'stylesheet',
          href: url
        });
    }

    function load_js(url, func) {
      $('<script>')
        .appendTo('head')
        .attr({
          src: url
        })
        .on('load', func);
    }
  </script>
  <style>
    .content-container {
      max-width: 960px;
      margin: 0 auto;
    }

    pre, p.asset {
      padding: 1em;
      background: #f5f2f0;
      overflow: auto;
    }

    p, h1, h2, h3, h4, h5, h6 {
      font-family: OpenSans,Arial,sans-serif;
      overflow-wrap: break-word;
    }

    img {
      max-width: 100%;
      margin: 0 auto;
    }

    table, th, td {
      border: 1px gray solid;
    }

    table {
      width: 100%;
      border-collapse: collapse;
    }

    th, td {
      padding: 0 10px;
    }
  </style>
</head>
<body>
  <div class="content-container">
{{ content }}
  </div>
</body>
</html>
