<% unless (description = context.description).empty? %>
<%= description %>
<% end %>
<% unless context.requires.empty? %>
Required Files
<% context.requires.each do |req| %>
- <%= h req.name %>
<% end %>
<% end %>
<% sections = context.sections.select { |s| s.title }.sort_by{ |s| s.title.to_s } %>
<% unless sections.empty? then %>
Sections
<% end %>
<% unless context.classes_and_modules.empty? %>
Namespace
<% (context.modules.sort + context.classes.sort).each do |mod| %>
-
<%= mod.type.upcase %>
<%= mod.full_name %>
<% end %>
<% end %>
<% unless context.method_list.empty? %>
Methods
<% each_letter_group(context.method_list) do |group| %>
- <%= group[:name] %>
-
<% group[:methods].each_with_index do |method, i| %>
<%
comma = group[:methods].size == i+1 ? '' : ','
%>
-
<%= h method.name %><%= comma %>
<% end %>
<% end %>
<% end %>
<% unless context.includes.empty? %>
Included Modules
<% context.includes.each do |inc| %>
-
<% unless String === inc.module %>
<%= h inc.module.full_name %>
<% else %>
<%= h inc.name %>
<% end %>
<% end %>
<% end %>
<% context.each_section do |section, constants, attributes| %>
<% if section.title then %>
<%= h section.title %>
<% end %>
<% if section.comment then %>
<%= section.description %>
<% end %>
<% unless constants.empty? %>
Constants
<% context.each_constant do |const| %>
<%= h const.name %> |
= |
<%= h const.value %> |
<% if const.comment %>
|
<%= const.description.strip %> |
<% end %>
<% end %>
<% end %>
<% unless attributes.empty? %>
Attributes
<% attributes.each do |attrib| %>
[<%= attrib.rw %>]
|
<%= h attrib.name %> |
<%= attrib.description.strip %> |
<% end %>
<% end %>
<%
context.methods_by_type(section).each do |type, visibilities|
next if visibilities.empty?
visibilities.each do |visibility, methods|
next if methods.empty?
%>
<%= type.capitalize %> <%= visibility.to_s.capitalize %> methods
<% methods.each do |method| %>
<% if method.comment %>
<%= method.description.strip %>
<% end %>
<% unless method.aliases.empty? %>
Also aliased as: <%= method.aliases.map do |aka|
if aka.parent then # HACK lib/rexml/encodings
%{
#{h aka.name}}
else
h aka.name
end
end.join ", " %>
<% end %>
<% if method.is_alias_for then %>
<% end %>
<% if method.token_stream %>
<% markup = method.sdoc_markup_code %>
<%
# generate github link
github = if options.github
if markup =~ /File\s(\S+), line (\d+)/
path = $1
line = $2.to_i
end
path && github_url(path)
else
false
end
%>
Source:
show
<% if github %>
| " target="_blank" class="github_url">on GitHub
<% end %>
<% end %>
<% end #methods.each %>
<% end #visibilities.each %>
<% end #context.methods_by_type %>
<% end #context.each_section %>