<html>

  <head>
    <title>Hydra docs: <%= group['name'] %> module</title>
    <link href="normalize.css" media="all" rel="stylesheet" type="text/css"/>
    <link href="styles.css" media="all" rel="stylesheet" type="text/css"/>
  </head>

  <body>

    <div id="modules">
      <h2>Modules</h2>
      <ul>
        <% groups.each do |g| %>
        <li><a href="<%= g['name'] %>.html"><%= g['name'] %></a></li>

        <% if g == group %>

        <ul>

        <% group['items'].sort_by{|i|i['def']}.each do |item| %>
        <li><a href="#<%= item['name'] %>"><%= item['name'] %></a></li>
        <% end %>

        </ul>

        <% end %>

        <% end %>
      </ul>
    </div>

    <div id="module">
      <h1><%= group['name'] %></h1>
      <p><%= group['doc'] %></p>

      <% group['items'].sort_by{|i|i['def']}.each do |item| %>

      <section id="<%= item['name'] %>">
        <h3><a href="#<%= item['name'] %>"><%= item['name'] %></a></h3>
        <code><%= item['def'] %></code>
        <p><%= item['doc'].gsub("\n", "<br>") %></p>
      </section>

      <% end %>
    </div>

  </body>
</html>

<html>

  <head>
    <title>Hydra docs: <%= group['name'] %> module</title>
    <link href="normalize.css" media="all" rel="stylesheet" type="text/css"/>
    <link href="styles.css" media="all" rel="stylesheet" type="text/css"/>
  </head>

  <body>

    <div id="modules">
      <h2>Modules</h2>
      <ul>
        <% groups.sort_by{|g|g['name']}.each do |g| %>
        <li><a href="<%= g['name'] %>.html"><%= g['name'] %></a></li>

        <% if g == group %>

        <ul>

        <% group['items'].sort_by{|i|i['def']}.each do |item| %>
        <li><a href="#<%= item['name'] %>"><%= item['name'] %></a></li>
        <% end %>

        </ul>

        <% end %>

        <% end %>
      </ul>
    </div>

    <div id="module">
      <h1><%= group['name'] %></h1>
      <p><%= group['doc'] %></p>

      <% group['items'].sort_by{|i|i['def']}.each do |item| %>

      <section id="<%= item['name'] %>">
        <h3><a href="#<%= item['name'] %>"><%= item['name'] %></a></h3>
        <code><%= item['def'] %></code>
        <p><%= item['doc'].gsub("\n", "<br>") %></p>
      </section>

      <% end %>
    </div>

  </body>
</html>

Sort groups in HTML docs.
Sort groups in HTML docs.
