summaryrefslogtreecommitdiff
path: root/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/generator/template/darkfish/table_of_contents.rhtml')
-rw-r--r--lib/rdoc/generator/template/darkfish/table_of_contents.rhtml13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
index 303d7016cc..54a376c9e5 100644
--- a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
+++ b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
@@ -8,14 +8,14 @@
<ul>
<%- simple_files.sort.each do |file| -%>
<li class="file">
- <a href="<%= file.path %>"><%= h file.page_name %></a>
+ <a href="<%= h file.path %>"><%= h file.page_name %></a>
<%
# HACK table_of_contents should not exist on Document
table = file.parse(file.comment).table_of_contents
unless table.empty? then %>
<ul>
<%- table.each do |heading| -%>
- <li><a href="<%= file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a>
+ <li><a href="<%= h file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a>
<%- end -%>
</ul>
<%- end -%>
@@ -36,8 +36,9 @@
unless table.empty? then %>
<ul>
<%- table.each do |item| -%>
- <li><a href="<%= klass.path %>#<%= item.aref %>"><%= item.plain_html %></a>
-<%- end -%>
+<%- label = item.respond_to?(:label) ? item.label(klass) : item.aref -%>
+ <li><a href="<%= klass.path %>#<%= label %>"><%= item.plain_html %></a>
+<%- end -%>
</ul>
<%- end -%>
</li>
@@ -46,9 +47,9 @@
<h2 id="methods">Methods</h2>
<ul>
-<%- @store.all_classes_and_modules.map do |mod|
+<%- @store.all_classes_and_modules.flat_map do |mod|
mod.method_list
- end.flatten.sort.each do |method| %>
+ end.sort.each do |method| %>
<li class="method">
<a href="<%= method.path %>"><%= h method.pretty_name %></a>
&mdash;