<!DOCTYPE html>
<%@params doc %>
<%@import org.eclipse.golo.doc.HtmlProcessor %>
<%
let CONFIG = com.github.rjeschke.txtmark.Configuration.builder()
  : forceExtentedProfile()
  : setCodeBlockEmitter(blockHighlighter())
  : build()
%>
<html>
<head>
  <title>Documentation for <%= doc: moduleName() %></title>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <style>
    body {
      font-family: Helvetica, Arial, sans-serif;
      color: #333;
      background-color: #fff;
      border-color: #999999;
      border-width: 2px;
      margin: 1em auto;
      margin-left: 20em;
      max-width: 50em;
      text-align: left;
      padding: 0.5em;
    }
    pre {
      background-color: #eee;
      -webkit-border-radius: 5px;
      -moz-border-radius: 5px;
      border-radius: 5px;
      overflow: auto;
    }
    code {
      font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
      font-size: 80%;
      background-color: #eee;
      padding: 1px 3px;
      -webkit-border-radius: 2px;
      -moz-border-radius: 2px;
      border-radius: 2px;
    }
    pre code {
      font-size: 120%;
      padding-left: 0px;
      padding-right: 0px;
    }

    .listing:hover code[data-lang]:before {
      display: block;
    }

    .listing code {
      position: relative;
    }

    .listing code[data-lang]:before {
      display: none;
      content: attr(data-lang);
      position: absolute;
      font-size: 0.75em;
      top: .5rem;
      right: 0.5rem;
      line-height: 1;
      text-transform: uppercase;
      color: #000;
    }

    li p {
      margin: 0.3em;
    }
    ul > li {
      list-style-type: disc;
    }
    a:link, a:visited {
      color: #33e;
      text-decoration: none;
    }
    a:hover {
      color: #00f;
      text-decoration:underline;
    }
    h1 {
      color: #999;
      font-weight: 400;
      font-size: 250%;
    }
    h2 {
      border-bottom: 1px dotted #aaa;
      margin-bottom: 1em;
      color: #333;
      font-size: 200%;
      font-style: normal;
      font-weight: bold;
    }
    h3 {
      color: #666;
      font-size: 180%;
      font-style: normal;
      font-weight: bold;
    }
    h4 {
      font-size: 130%;
      font-style: normal;
      font-weight: bold;
    }
    h5 {
      font-size: 100%;
      font-style: normal;
      font-weight: bold;
    }
    h6 {
      font-size: 100%;
      font-style: italic;
      font-weight: normal;
    }

    #toc {
      margin: 0;
      padding: 0;
      position: fixed;
      top: 0px;
      bottom: 0px;
      left: 0px;
      width: 20em;
      overflow: auto;
      white-space: nowrap;
    }

    #toc h1 {
      margin: .5em;
      padding: 1ex;
      font-size: 90%;
      font-weight: bold;
      font-style: normal;
      color: #333;
      background-color: #eee;
      text-align: center;
    }

    #toc ul {
      padding-left: 1em;
    }

    #toc > ul {
      font-size: 80%;
      margin: 0.5em;
    }

    #toc > ul > li {
      list-style: none;
      margin-bottom: 2ex;
    }

    #toc > ul > li > a {
      font-weight: bold;
      color: #333;
      display: block;
      padding: 1ex;
      margin: 0 1em 1ex 0;
      border-bottom: 1px solid #999;
    }

    #toc li {
      list-style-type: none;
    }

    :target {
      background-color: yellow;
    }

    .permalink {
      margin-left: .3em;
      font-size: 70%;
      visibility: hidden;
    }

    *:hover > .permalink {
      visibility: visible;
    }

    .golodoc {
      margin: 0;
      padding: 0;
      padding-left: 1.5em;
    }

    @media (max-width: 50em) {
      #toc {
        display: none;
      }

      body {
        margin: 0;
        padding: 0.5em;
      }

      h1 {
        font-size: 200%;
      }
    }

  </style>
</head>
<body>
<h1>Documentation for <%= doc: moduleName() %></h1>
<!-- begin table of content -->
<nav id="toc">
<h1><%= doc: moduleName() %></h1>
<ul>

  <% if not doc: structs(): isEmpty() { %>
  <li><a href="#structs">Structs</a><ul>
    <% foreach structDoc in doc: structs() { %>
    <li><a href="#<%= structDoc: name() %>"><%= structDoc: name() %></a></li>
    <% } %>
  </ul></li>
  <% } %>

  <% if not doc: unions(): isEmpty() { %>
  <li><a href="#unions">Unions</a><ul>
    <% foreach unionDoc in doc: unions() { %>
    <li><a href="#<%= unionDoc: name() %>"><%= unionDoc: name() %></a></li>
    <% } %>
  </ul></li>
  <% } %>



  <% if not doc: namedAugmentations(): isEmpty() { %>
  <li><a href="#namedAugmentations">Named Augmentations</a><ul>
    <% foreach namedAugmentationDoc in doc: namedAugmentations() { %>
    <li><a href="#<%= namedAugmentationDoc: name() %>"><%= namedAugmentationDoc: name()%></a><ul>
      <% foreach funcDoc in namedAugmentationDoc { %>
      <li><a href="#<%= namedAugmentationDoc: name() %>.<%= funcDoc: name() %>_<%=
              funcDoc: arguments(): size() %>"><%= funcDoc: name() %>(<%= funcDoc: arguments(): join(", ") %>)</a></li>
      <% } %>
      </ul></li>
    <% } %>
  </ul></li>
  <% } %>

  <% if not doc: augmentations(): isEmpty() { %>
  <li><a href="#augmentations">Augmentations</a><ul>
    <% foreach augmentDoc in doc: augmentations() { %>
    <li><a href="#augment.<%= augmentDoc: target() %>"><%= augmentDoc: target() %></a><ul>
      <% foreach funcDoc in augmentDoc { %>
      <li><a href="#<%= augmentDoc: target() %>.<%= funcDoc: name() %>_<%=
              funcDoc: arguments(): size() %>"><%= funcDoc: name() %>(<%= funcDoc: arguments(): join(", ") %>)</a></li>
      <% } %>
    </ul></li>
    <% } %>
  </ul></li>
  <% } %>

  <% if not doc: functions(): isEmpty() { %>
  <li><a href="#functions">Functions</a><ul>
    <% foreach funcDoc in doc: functions() { %>
    <li><a href="#<%= funcDoc: name() %>_<%= funcDoc: arguments(): size()
            %>"><%= funcDoc: name() %>(<%= funcDoc: arguments(): join(", ") %>)</a></li>
    <% } %>
  </ul></li>
  <% } %>
</ul>
</nav>
<!-- end table of content -->

<div class="golodoc">
  <%= process(doc: moduleDocumentation(), 1, CONFIG) %>
</div>

<% if not doc: structs(): isEmpty() { %>
  <h2 id="structs">Structs</h2>
  <% foreach structDoc in doc: structs() { %>
    <h3 id="<%= structDoc: name() %>"><%= structDoc: name() %>
    <a class="permalink" href="#<%= structDoc: name() %>" title="link to this section">&#182;</a></h3>

    <h5>Members</h5>
    <ul>
    <% foreach member in structDoc: members() { %>
      <li><code><%= member %></code></li>
  <% } %>
    </ul>
    <div class="golodoc">
      <%= process(structDoc: documentation(), 3, CONFIG) %>
    </div>
  <% } %>
<% } %>

<% if not doc: unions(): isEmpty() { %>
  <h2 id="unions">Unions</h2>
  <% foreach unionDoc in doc: unions() { %>
    <h3 id="<%= unionDoc: name() %>"><%= unionDoc: name() %>
    <a class="permalink" href="#<%= unionDoc: name() %>" title="link to this section">&#182;</a></h3>

    <div class="golodoc">
    <%= process(unionDoc: documentation(), 3, CONFIG) %>
    </div>

    <% foreach unionValueDoc in unionDoc: values() { %>
    <h4 id="<%= unionDoc: name() %>.<%= unionValueDoc: name() %>">
        <%= unionValueDoc: name() %>
        <a class="permalink" href="#<%= unionDoc: name() %>.<%= unionValueDoc: name() %>"
            title="link to this section">&#182;</a>
    </h4>

    <% if not unionValueDoc: members(): isEmpty() { %>
      <ul>
      <% foreach member in unionValueDoc: members() { %>
        <li><code><%= member %></code></li>
      <% } %>
      </ul>
    <% } %>

    <div class="golodoc"><%= process(unionValueDoc: documentation(), 4, CONFIG) %></div>

    <% } %>
  <% } %>
<% } %>

<% if not doc: namedAugmentations(): isEmpty() { %>
  <h2 id="namedAugmentations">Named Augmentations</h2>
  <% foreach namedAugmentationDoc in doc: namedAugmentations() { %>
    <h3 id="<%= namedAugmentationDoc: name()%>"><%= namedAugmentationDoc: name()%>
    <a class="permalink" href="#<%= namedAugmentationDoc: name()%>" title="link
    to this section">&#182;</a></h3>
    <div class="golodoc">
      <%= process(namedAugmentationDoc: documentation(), 3, CONFIG) %>
    </div>
    <% foreach funcDoc in namedAugmentationDoc { %>
      <% if funcDoc: varargs() { %>
        <h4 id="<%= namedAugmentationDoc: name() %>.<%= funcDoc: name() %>_<%= funcDoc: arguments(): size() %>"><%= funcDoc: name() %>(<%= funcDoc: arguments(): join(", ") %>...)
      <% } else { %>
        <h4 id="<%= namedAugmentationDoc: name() %>.<%= funcDoc: name() %>_<%= funcDoc: arguments(): size() %>"><%= funcDoc: name() %>(<%= funcDoc: arguments(): join(", ") %>)
      <% } %>
      <a class="permalink" href="#<%= namedAugmentationDoc: name() %>.<%= funcDoc: name() %>_<%= funcDoc: arguments(): size() %>" title="link to this section">&#182;</a></h4>
      <div class="golodoc">
        <%= process(funcDoc: documentation(), 4, CONFIG) %>
      </div>
    <% } %>
  <% } %>
<% } %>


<% if not doc: augmentations(): isEmpty() { %>
  <h2 id="augmentations">Augmentations</h2>
  <% foreach augmentDoc in doc: augmentations() { %>
    <h3 id="augment.<%= augmentDoc: target() %>"><%= augmentDoc: target() %>
    <a class="permalink" href="#augment.<%= augmentDoc: target() %>" title="link to this section">&#182;</a></h3>
    <div class="golodoc">
      <%= process(augmentDoc: documentation(), 3, CONFIG) %>
    </div>
    <% if not augmentDoc: augmentationNames(): isEmpty() { %>
      <h5>Named augmentations applied</h5>
      <ul>
      <% foreach name in augmentDoc: augmentationNames() { %>
      <li>
        <%if not name: contains(".") {%>
          <a href="#<%=name%>"><%= name %></a>
        <%} else {%>
        <%= name %>
        <%}%>
      </li>
      <% } %>
      </ul>
    <% } %>
    <% foreach funcDoc in augmentDoc { %>
      <% if funcDoc: varargs() { %>
        <h4 id="<%= augmentDoc: target() %>.<%= funcDoc: name() %>_<%= funcDoc: arguments(): size() %>"><%= funcDoc: name() %>(<%= funcDoc: arguments(): join(", ") %>...)
      <% } else { %>
        <h4 id="<%= augmentDoc: target() %>.<%= funcDoc: name() %>_<%= funcDoc: arguments(): size() %>"><%= funcDoc: name() %>(<%= funcDoc: arguments(): join(", ") %>)
      <% } %>
      <a class="permalink" href="#<%= augmentDoc: target() %>.<%= funcDoc: name() %>_<%= funcDoc: arguments(): size() %>" title="link to this section">&#182;</a></h4>
      <div class="golodoc">
        <%= process(funcDoc: documentation(), 4, CONFIG) %>
      </div>
    <% } %>
  <% } %>
<% } %>

<% if not doc: functions(): isEmpty() { %>
  <h2 id="functions">Functions</h2>
  <% foreach funcDoc in doc: functions() { %>
    <h3 id="<%= funcDoc: name() %>_<%= funcDoc: arguments(): size() %>"><%= funcDoc: name() %>(<%= funcDoc: arguments(): join(", ") %>)
    <a class="permalink" href="#<%= funcDoc: name() %>_<%= funcDoc: arguments(): size() %>" title="link to this section">&#182;</a></h3>
    <div class="golodoc">
      <%= process(funcDoc: documentation(), 3, CONFIG) %>
    </div>
  <% } %>
<% } %>

<link rel="stylesheet" href="http://golo-lang.org/documentation/next/styles/github.min.css"/>
<script src="http://golo-lang.org/documentation/next/highlight.min.js"></script>
<script>hljs.initHighlighting()</script>
</body>

</body>
</html>
