1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
drbrain 182ce60f75 * lib/rdoc/class_module.rb: Added RDoc::ClassModule#documented? which
checks comment_location.  Hide RDoc::ClassModule#comment=.
* test/rdoc/test_rdoc_class_module.rb:  Test for above.

* lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml:
  Fix display of the table of contents in the sidebar.

* lib/rdoc/generator/template/darkfish/table_of_contents.rhtml:
  Use #comment_location when displaying classes or modules.

* test/rdoc/test_rdoc_store.rb:  Use comment_location.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-12 05:16:53 +00:00

55 lines
1.6 KiB
Text

<body class="indexpage">
<h1><%= h @title %></h1>
<% simple_files = @files.select { |f| f.text? } %>
<% unless simple_files.empty? then %>
<h2>Pages</h2>
<ul>
<% simple_files.sort.each do |file| %>
<li class="file">
<a href="<%= 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 %>
<img class="toc-toggle" src="images/transparent.png" alt="" title="toggle headings">
<ul class="initially-hidden">
<% table.each do |heading| %>
<li><a href="<%= file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a>
<% end %>
</ul>
<% end %>
</li>
<% end %>
</ul>
<% end %>
<h2 id="classes">Classes/Modules</h2>
<ul>
<% @modsort.each do |klass| %>
<li class="<%= klass.type %>">
<a href="<%= klass.path %>"><%= klass.full_name %></a>
<% table = []
table.concat klass.parse(klass.comment_location).table_of_contents
table.concat klass.section_contents
unless table.empty? then %>
<img class="toc-toggle" src="images/transparent.png" alt="" title="toggle headings">
<ul class="initially-hidden">
<% table.each do |item| %>
<li><a href="<%= klass.path %>#<%= item.aref %>"><%= item.plain_html %></a>
<% end %>
</ul>
<% end %>
</li>
<% end %>
</ul>
<h2 id="methods">Methods</h2>
<ul>
<% @store.all_classes_and_modules.map do |mod|
mod.method_list
end.flatten.sort.each do |method| %>
<li class="method"><a href="<%= method.path %>"><%= method.pretty_name %> &mdash; <%= method.parent.full_name %></a>
<% end %>
</ul>