{%- macro page_header(pageTitle, path_to_root, texturl) -%}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html>
  <head><title>{{ pageTitle }}</title>
  <link rel="stylesheet" href="{{ path_to_root }}default.css" type="text/css" />
  <script type="text/javascript">                                                                                                                                                                                                                                                                                                                                         
    var active = true;
    window.onscroll = function() {                                                                                                                                                                                                                                                                                                                                        
      var html = document.documentElement;
      active = (document.body.scrollTop + html.clientHeight >= document.body.scrollHeight - 30);                                                                                                                                                                                                                                                                          
    }
    window.setInterval(function() {                                                                                                                                                                                                                                                                                                                                       
      if (active) {
        document.body.scrollTop = document.body.scrollHeight;                                                                                                                                                                                                                                                                                                             
      }
    }, 300);                                                                                                                                                                                                                                                                                                                                                              
  </script>
  </head>
  <body class='log'>
    <a href="{{ texturl }}">(view as text)</a><br/>
    <pre>  
{%- endmacro -%}

{%- macro chunks(entries) -%}
{%- for entry in entries -%}
    <span class="{{ entry.type }}">{{ entry.text|e }}</span>
{%- endfor -%}
{%- endmacro -%}

{%- macro page_footer() -%}
</pre>
</body>
</html>
{%- endmacro -%}
