<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>{{self.sections[1].title}}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">



    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
    {% if self.opts.css then %}
    {{ self.opts.css }}
    <link href="{{self.opts.css}}" rel="stylesheet">
    {% else %}
    <link href="css/docs.css" rel="stylesheet">
    {% end %}
    {{self.opts.head or ''}}
  </head>

  <body>
    <div class="header">
      <div class="container">
        <div class='row'>
          <div class='span12'>
            {{self.header}}
          </div>
        </div>
      </div>
    </div>

    <div class="container">

      <div class="row">

        <div class='span3 local-nav'>
          <ul class='nav nav-tabs nav-stacked affix'>
            {% for i, section in ipairs(self.sections) do %}
            <li><a href='#{{section.name}}'><i class='icon-chevron-right'></i> {{i == 1 and self.fullname or section.title}}</a></li>
            {% end %}
          </ul>
        </div>

        <div class='main span7'>

          {% for _, section in ipairs(self.sections) do %}
          <section id='{{section.name}}'>
          <h2 class='section'>{{section.title}}</h2>

          {% for _, group in ipairs(section) do %}
          {% if group.class then %}
          <h4 id='{{string.gsub(group.class, '.', '-')}}' class='entry klass'><a href='{{group.class}}.html'>{{group.name}}</a></h4>
          {% elseif group.fun then %}
          <h4 id='{{group.fun}}' class='entry method'><span>:</span>{{group.fun}} <code>{{group.params}}</code></h4>
          {% elseif group.class_fun then %}
          <h4 id='{{group.class_fun}}' class='entry function'><span>.</span>{{group.class_fun}} <code>{{group.params}}</code></h4>
          {% elseif group.global_fun then %}
          <h4 id='{{group.global_fun}}' class='entry function'>{{group.global_fun}} <code>{{group.params}}</code></h4>
          {% elseif group.tparam then %}
          <h4 id='{{group.tparam}}' class='entry tparam'>{{group.tparam}} <code>= {{group.params}}</code></h4>
          {% elseif group.lparam then %}
          <h4 id='{{group.tparam}}' class='entry lparam'><code>{{group.lparam}}</code></h4>
          {% elseif group.const then %}
          <h4 id='{{group.const}}' class='entry const'>{{group.const}}</h4>
          {% elseif group.param  == '' then %}
          <h4 id='{{group.param}}' class='entry param'><code>{{group.params}}</code></h4>
          {% elseif group.param then %}
          <h4 id='{{group.param}}' class='entry param'><span>.</span>{{group.param}} <code>= {{group.params}}</code></h4>
          {% end %}

          {% for _, para in ipairs(group) do %}
          {{private.paraToHtml(self, para)}}
          {% end %}
          {% end %}
          </section>
          {% end %}
        </div>

        <div class='span2 global-nav'>
          <ul class='nav nav-tabs nav-stacked'>
            {% if self.module then %}
            <li class='module'><a href='{{self.module}}.html'>{{self.module}}</a></li>
            {% elseif self.toplevel then %}
            <li class='module'><a href='index.html'><span></span>{{self.name}}</a></li>
            {% end %}

            {% for _, name in ipairs(self.navigation) do 
              local fullname = self.navigation[name].__fullname
              local class = fullname == self.fullname and 'active'
              if not self.module and class then
                class = 'module'
              end
            %}
            <li class='{{class}}'><a href='{{fullname}}.html'>{{name}}</a></li>
            {% end %}
          </ul>
        </div>
      </div>
    </div>

    <footer class="footer">
    <div class="container">
      {{self.footer}}
    </div>
    </footer>

    <script src='https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?lang=lua'></script>
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        config: ["MMLorHTML.js"],
        jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML"],
        extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],
        TeX: {
          extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
        },
        displayAlign: "left",
        menuSettings: {
          zoom: "Hover",
          mpContext: true,
          mpMouse: true
        },
      });
    </script>
    <script type="text/javascript"
      src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
    </script>
    <script src='http://code.jquery.com/jquery.min.js'></script>
    <script src='js/bootstrap.min.js'></script>
  </body>
</html>

