summaryrefslogtreecommitdiff
path: root/ruby_1_9_3/lib/rdoc/generator/template/darkfish/classpage.rhtml
blob: 9c74cacf0f8b6510d92b1c71c92a51de3e492098 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<?xml version="1.0" encoding="<%= @options.charset %>"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />

  <title><%= klass.type.capitalize %>: <%= klass.full_name %></title>

  <link rel="stylesheet" href="<%= rel_prefix %>/rdoc.css" type="text/css" media="screen" />

  <script src="<%= rel_prefix %>/js/jquery.js" type="text/javascript" charset="utf-8"></script>
  <script src="<%= rel_prefix %>/js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
  <script src="<%= rel_prefix %>/js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
  <script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript" charset="utf-8"></script>

</head>
<body id="top" class="<%= klass.type %>">

  <div id="metadata">
    <div id="home-metadata">
      <div id="home-section" class="section">
        <h3 class="section-header">
          <a href="<%= rel_prefix %>/index.html">Home</a>
          <a href="<%= rel_prefix %>/index.html#classes">Classes</a>
          <a href="<%= rel_prefix %>/index.html#methods">Methods</a>
        </h3>
      </div>
    </div>

    <div id="file-metadata">
      <div id="file-list-section" class="section">
        <h3 class="section-header">In Files</h3>
        <div class="section-body">
          <ul>
          <% klass.in_files.each do |tl| %>
            <li><a href="<%= rel_prefix %>/<%= h tl.path %>?TB_iframe=true&amp;height=550&amp;width=785"
              class="thickbox" title="<%= h tl.absolute_name %>"><%= h tl.absolute_name %></a></li>
          <% end %>
          </ul>
        </div>
      </div>

      <% if !svninfo.empty? then %>
      <div id="file-svninfo-section" class="section">
        <h3 class="section-header">Subversion Info</h3>
        <div class="section-body">
          <dl class="svninfo">
            <dt>Rev</dt>
            <dd><%= svninfo[:rev] %></dd>

            <dt>Last Checked In</dt>
            <dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
              (<%= svninfo[:commitdelta] %> ago)</dd>

            <dt>Checked in by</dt>
            <dd><%= svninfo[:committer] %></dd>
          </dl>
        </div>
      </div>
      <% end %>
    </div>

    <div id="class-metadata">
      <% if klass.type == 'class' then %>
      <!-- Parent Class -->
      <div id="parent-class-section" class="section">
        <h3 class="section-header">Parent</h3>
        <% if klass.superclass and not String === klass.superclass then %>
        <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a></p>
        <% else %>
        <p class="link"><%= klass.superclass %></p>
        <% end %>
      </div>
      <% end %>

      <% unless klass.sections.length == 1 then %>
      <!-- Sections -->
      <div id="sections-section" class="section">
        <h3 class="section-header">Sections</h3>
        <ul class="link-list">
          <% klass.sections.sort_by { |s| s.title.to_s }.each do |section| %>
            <li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
          <% end %>
        </ul>
      </div>
      <% end %>

      <% unless klass.classes_and_modules.empty? then %>
      <!-- Namespace Contents -->
      <div id="namespace-list-section" class="section">
        <h3 class="section-header">Namespace</h3>
        <ul class="link-list">
          <% (klass.modules.sort + klass.classes.sort).each do |mod| %>
          <li><span class="type"><%= mod.type.upcase %></span> <a href="<%= klass.aref_to mod.path %>"><%= mod.full_name %></a></li>
          <% end %>
        </ul>
      </div>
      <% end %>

      <% unless klass.method_list.empty? then %>
      <!-- Method Quickref -->
      <div id="method-list-section" class="section">
        <h3 class="section-header">Methods</h3>
        <ul class="link-list">
          <% klass.each_method do |meth| %>
          <li><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= meth.name %></a></li>
          <% end %>
        </ul>
      </div>
      <% end %>

      <% unless klass.includes.empty? then %>
      <!-- Included Modules -->
      <div id="includes-section" class="section">
        <h3 class="section-header">Included Modules</h3>
        <ul class="link-list">
        <% klass.each_include do |inc| %>
        <% unless String === inc.module then %>
          <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
        <% else %>
          <li><span class="include"><%= inc.name %></span></li>
        <% end %>
        <% end %>
        </ul>
      </div>
      <% end %>
    </div>

    <div id="project-metadata">
      <% simple_files = @files.select {|tl| tl.parser == RDoc::Parser::Simple } %>
      <% unless simple_files.empty? then %>
      <div id="fileindex-section" class="section project-section">
        <h3 class="section-header">Files</h3>
        <ul>
        <% simple_files.each do |file| %>
          <li class="file"><a href="<%= rel_prefix %>/<%= file.path %>"><%= h file.base_name %></a></li>
        <% end %>
        </ul>
      </div>
      <% end %>

      <div id="classindex-section" class="section project-section">
        <h3 class="section-header">Class/Module Index
          <span class="search-toggle"><img src="<%= rel_prefix %>/images/find.png"
            height="16" width="16" alt="[+]"
            title="show/hide quicksearch" /></span></h3>
        <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
        <fieldset>
          <legend>Quicksearch</legend>
          <input type="text" name="quicksearch" value=""
            class="quicksearch-field" />
        </fieldset>
        </form>

        <ul class="link-list">
        <% @modsort.each do |index_klass| %>
          <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a></li>
        <% end %>
        </ul>
        <div id="no-class-search-results" style="display: none;">No matching classes.</div>
      </div>

      <% if $DEBUG_RDOC then %>
      <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
        alt="toggle debugging" height="16" width="16" /></div>
      <% end %>
    </div>
  </div>

  <div id="documentation">
    <h1 class="<%= klass.type %>"><%= klass.full_name %></h1>

    <div id="description" class="description">
      <%= klass.description %>
    </div><!-- description -->

    <% klass.each_section do |section, constants, attributes| %>
    <% constants = constants.select { |const| const.display? } %>
    <% attributes = attributes.select { |attr| attr.display? } %>
    <div id="<%= section.aref %>" class="documentation-section">
      <% if section.title then %>
      <h2 class="section-header">
        <%= section.title %>
        <a href="#top">&uarr; top</a>
      </h2>
      <% end %>

      <% if section.comment then %>
      <div class="description">
        <%= section.description %>
      </div>
      <% end %>

      <% unless constants.empty? then %>
      <!-- Constants -->
      <div id="constants-list" class="section">
        <h3 class="section-header">Constants</h3>
        <dl>
        <% constants.each do |const| %>
          <dt><a name="<%= const.name %>"><%= const.name %></a></dt>
          <% if const.comment then %>
          <dd class="description"><%= const.description.strip %></dd>
          <% else %>
          <dd class="description missing-docs">(Not documented)</dd>
          <% end %>
        <% end %>
        </dl>
      </div>
      <% end %>

      <% unless attributes.empty? then %>
      <!-- Attributes -->
      <div id="attribute-method-details" class="method-section section">
        <h3 class="section-header">Attributes</h3>

        <% attributes.each do |attrib| %>
        <div id="<%= attrib.html_name %>-attribute-method" class="method-detail">
          <a name="<%= h attrib.name %>"></a>
          <% if attrib.rw =~ /w/i then %>
          <a name="<%= h attrib.name %>="></a>
          <% end %>
          <div class="method-heading attribute-method-heading">
            <span class="method-name"><%= h attrib.name %></span><span
              class="attribute-access-type">[<%= attrib.rw %>]</span>
          </div>

          <div class="method-description">
          <% if attrib.comment then %>
          <%= attrib.description.strip %>
          <% else %>
          <p class="missing-docs">(Not documented)</p>
          <% end %>
          </div>
        </div>
        <% end %>
      </div><!-- attribute-method-details -->
      <% end %>

      <!-- Methods -->
      <% klass.methods_by_type(section).each do |type, visibilities|
         next if visibilities.empty?
         visibilities.each do |visibility, methods|
           next if methods.empty? %>
      <div id="<%= visibility %>-<%= type %>-method-details" class="method-section section">
        <h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>

      <% methods.each do |method| %>
        <div id="<%= method.html_name %>-method" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
          <a name="<%= h method.aref %>"></a>

          <% if method.call_seq then %>
          <% method.call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
          <div class="method-heading">
            <span class="method-callseq"><%= call_seq.strip.gsub(/->/, '&rarr;').gsub( /^\w+\./m, '') %></span>
            <% if i == 0 then %>
            <span class="method-click-advice">click to toggle source</span>
            <% end %>
          </div>
          <% end %>
          <% else %>
          <div class="method-heading">
            <span class="method-name"><%= h method.name %></span><span
              class="method-args"><%= method.params %></span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          <% end %>

          <div class="method-description">
            <% if method.comment then %>
            <%= method.description.strip %>
            <% else %>
            <p class="missing-docs">(Not documented)</p>
            <% end %>

            <% if method.token_stream then %>
            <div class="method-source-code" id="<%= method.html_name %>-source">
<pre>
<%= method.markup_code %>
</pre>
            </div><!-- <%= method.html_name %>-source -->
            <% end %>
          </div>

          <% unless method.aliases.empty? then %>
          <div class="aliases">
            Also aliased as: <%= method.aliases.map do |aka|
              if aka.parent then # HACK lib/rexml/encodings
                %{<a href="#{klass.aref_to aka.path}">#{h aka.name}</a>}
              else
                h aka.name
              end
            end.join ", " %>
          </div>
          <% end %>

          <% if method.is_alias_for then %>
          <div class="aliases">
            Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
          </div>
          <% end %>
        </div><!-- <%= method.html_name %>-method -->

      <% end %>
      </div><!-- <%= visibility %>-<%= type %>-method-details -->
    <% end
       end %>
    </div><!-- <%= section.aref %> -->
  <% end %>

  </div><!-- documentation -->

  <div id="validator-badges">
    <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
    <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
      Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
  </div>

</body>
</html>