File: table_of_contents.rhtml

package info (click to toggle)
ruby3.1 3.1.2-7%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 132,892 kB
  • sloc: ruby: 1,154,753; ansic: 736,782; yacc: 46,445; pascal: 10,401; sh: 3,931; cpp: 1,158; python: 838; makefile: 787; asm: 462; javascript: 382; lisp: 97; sed: 94; perl: 62; awk: 36; xml: 4
file content (58 lines) | stat: -rw-r--r-- 1,541 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<body id="top" class="table-of-contents">
<main role="main">
<h1 class="class"><%= h @title %></h1>

<%- simple_files = @files.select { |f| f.text? } -%>
<%- unless simple_files.empty? then -%>
<h2 id="pages">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 %>
    <ul>
<%- 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 and 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 %>
    <ul>
<%- 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 %>"><%= h method.pretty_name %></a>
    &mdash;
    <span class="container"><%= method.parent.full_name %></span>
<%- end -%>
</ul>
</main>