<% require 'doc_format' # set default page title if none was given unless page_title if h = @nodeTree.group2nodes[:latex].first page_title = h.title end end Listing = Struct.new(:name, :anchor, :key, :nodes) unless defined? Listing listings = ( DocProxy::GROUP2TYPES[:admonition] + DocProxy::GROUP2TYPES[:formal] ).flatten.inject([]) do |ary, key| nodes = @nodeTree.type2nodes[key] unless nodes.empty? ary << Listing.new(key.to_s.capitalize << 's', "toc:#{key}".to_html_anchor, key, nodes) end ary end %> <%= page_title %> <% if insert_toc %> <% end %>
<%= content %>
<% if insert_toc %>

Contents

<%= toc %> <% listings.each do |x| %>

<%= x.name %>

    <% x.nodes.map do |node| %> <%= %{
  1. #{node.title.to_html}
  2. } %> <% end %>
<% end %>
<% end %>