Develop and Download Open Source Software

Browse Subversion Repository

Contents of /rdoc_template.rb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (show annotations) (download)
Sat Apr 7 14:45:49 2007 UTC (16 years, 11 months ago) by bluedwarf
File size: 10039 byte(s)
Small improvements of the RDoc template.

1 # edmaru_template.rb: an RDoc template file for Edmaru.
2 #
3 # Copyright (C) 2007 Takashi Nakamoto
4 #
5 # This template file is based on kilmer.rb distribued with RDoc. RDoc
6 # is published from the web-site below:
7 # http://rdoc.sourceforge.net/
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2 as
11 # published by the Free Software Foundation.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 # 02110-1301 USA.
22 #
23
24 module RDoc
25 module Page
26
27
28 FONTS = "Verdana, Arial, Helvetica, sans-serif"
29
30 STYLE = %{
31 body,td,p { font-family: %fonts%;
32 color: #000040;
33 }
34
35 .attr-rw { font-size: xx-small; color: #444488 }
36
37 .title-row { background-color: #AA0000;
38 color: white;
39 }
40
41 .big-title-font {
42 color: white;
43 font-weight: bold;
44 font-family: %fonts%;
45 font-size: x-large;
46 height: 60px;
47 padding: 10px 3px 10px 3px;
48 }
49
50 .classmod {
51 color: white;
52 font-weight: bold;
53 font-family: %fonts%;
54 font-size: medium;
55 }
56
57 .small-title-font { color: white;
58 font-family: %fonts%;
59 font-size: small; }
60
61 .aqua { color: black }
62
63 .method-name, .attr-name {
64 font-family: font-family: %fonts%;
65 font-weight: bold;
66 font-size: normal;
67 margin-left: 20px;
68 color: #000033;
69 }
70
71 .tablesubtitle, .tablesubsubtitle {
72 width: 100%;
73 margin-top: 1ex;
74 margin-bottom: .5ex;
75 padding: 5px 0px 5px 3px;
76 font-size: large;
77 font-weight: bold;
78 color: white;
79 background-color: #AA0000;
80 border: thin;
81 }
82
83 .name-list {
84 margin-left: 5px;
85 margin-bottom: 2ex;
86 line-height: 105%;
87 }
88
89 .description {
90 margin-left: 20px;
91 margin-bottom: 2ex;
92 line-height: 105%;
93 font-size: normal;
94 }
95
96 h3{
97 font-size: medium;
98 }
99
100 .methodtitle {
101 font-size: normal;
102 font-weight: bold;
103 text-decoration: none;
104 color: #000066;
105 background-color: ffcccc;
106 }
107
108 .srclink {
109 color: #000066;
110 text-decoration: none;
111 }
112
113 .paramsig {
114 font-size: small;
115 }
116
117 .srcbut { float: right }
118
119 }
120
121
122 ############################################################################
123
124
125 BODY = %{
126 <html><head>
127 <title>%title%</title>
128 <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
129 <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
130 <script type="text/javascript" language="JavaScript">
131 <!--
132 function popCode(url) {
133 parent.frames.source.location = url
134 }
135 //-->
136 </script>
137 </head>
138 <body bgcolor="white">
139
140 !INCLUDE! <!-- banner header -->
141
142 IF:diagram
143 <table width="100%"><tr><td align="center">
144 %diagram%
145 </td></tr></table>
146 ENDIF:diagram
147
148 IF:description
149 <div class="description">%description%</div>
150 ENDIF:description
151
152 IF:requires
153 <table cellpadding="5" width="100%">
154 <tr><td class="tablesubtitle">Required files</td></tr>
155 </table><br />
156 <div class="name-list">
157 START:requires
158 HREF:aref:name:
159 END:requires
160 ENDIF:requires
161 </div>
162
163 IF:methods
164 <table cellpadding="5" width="100%">
165 <tr><td class="tablesubtitle">Methods</td></tr>
166 </table><br />
167 <div class="name-list">
168 START:methods
169 HREF:aref:name:,
170 END:methods
171 </div>
172 ENDIF:methods
173
174
175 START:sections
176 <div id="section">
177 IF:sectitle
178 <h2 class="section-title"><a name="%secsequence%">%sectitle%</a></h2>
179 IF:seccomment
180 <div class="section-comment">
181 %seccomment%
182 </div>
183 ENDIF:seccomment
184 ENDIF:sectitle
185
186 IF:attributes
187 <table cellpadding="5" width="100%">
188 <tr><td class="tablesubtitle">Attributes</td></tr>
189 </table><br />
190 <table cellspacing="5">
191 START:attributes
192 <tr valign="top">
193 IF:rw
194 <td align="center" class="attr-rw">&nbsp;[%rw%]&nbsp;</td>
195 ENDIF:rw
196 IFNOT:rw
197 <td></td>
198 ENDIF:rw
199 <td class="attr-name">%name%</td>
200 <td>%a_desc%</td>
201 </tr>
202 END:attributes
203 </table>
204 ENDIF:attributes
205
206 IF:classlist
207 <table cellpadding="5" width="100%">
208 <tr><td class="tablesubtitle">Classes and Modules</td></tr>
209 </table><br />
210 %classlist%<br />
211 ENDIF:classlist
212
213 !INCLUDE! <!-- method descriptions -->
214
215 END:sections
216
217 </body>
218 </html>
219 }
220
221 ###############################################################################
222
223 FILE_PAGE = <<_FILE_PAGE_
224 <table width="100%">
225 <tr class="title-row">
226 <td><table width="100%"><tr>
227 <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font>%short_name%</td>
228 <td align="right"><table cellspacing="0" cellpadding="2">
229 <tr>
230 <td class="small-title-font">Path:</td>
231 <td class="small-title-font">%full_path%
232 IF:cvsurl
233 &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
234 ENDIF:cvsurl
235 </td>
236 </tr>
237 <tr>
238 <td class="small-title-font">Modified:</td>
239 <td class="small-title-font">%dtm_modified%</td>
240 </tr>
241 </table>
242 </td></tr></table></td>
243 </tr>
244 </table><br />
245 _FILE_PAGE_
246
247 ###################################################################
248
249 CLASS_PAGE = %{
250 <table width="100%" border="0" cellspacing="0">
251 <tr class="title-row">
252 <td class="big-title-font">
253 <span class="classmod">%classmod%<br /></span>%full_name%
254 </td>
255 <td align="right">
256 <table cellspacing="0" cellpadding="2">
257 <tr valign="top">
258 <td class="small-title-font">In:</td>
259 <td class="small-title-font">
260 START:infiles
261 <b>
262 HREF:full_path_url:full_path:
263 </b>
264 IF:cvsurl
265 &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
266 ENDIF:cvsurl
267 END:infiles
268 </td>
269 </tr>
270 IF:parent
271 <tr>
272 <td class="small-title-font">Parent:</td>
273 <td class="small-title-font">
274 IF:par_url
275 <a href="%par_url%" class="cyan">
276 ENDIF:par_url
277 %parent%
278 IF:par_url
279 </a>
280 ENDIF:par_url
281 </td>
282 </tr>
283 ENDIF:parent
284 </table>
285 </td>
286 </tr>
287 </table><br />
288 }
289
290 ###################################################################
291
292 METHOD_LIST = %{
293 IF:includes
294 <div class="tablesubsubtitle">Included modules</div><br />
295 <div class="name-list">
296 START:includes
297 <span class="method-name">HREF:aref:name:</span>
298 END:includes
299 </div>
300 ENDIF:includes
301
302 IF:method_list
303 START:method_list
304 IF:methods
305 <table cellpadding=5 width="100%">
306 <tr><td class="tablesubtitle">%type% %category% methods</td></tr>
307 </table>
308 START:methods
309 <table width="100%" cellspacing="0" cellpadding="5" border="0">
310 <tr><td class="methodtitle">
311 <a name="%aref%">
312 IF:callseq
313 IF:codeurl
314 <a href="%codeurl%" target="source" class="srclink"><b>%callseq%</b></a>
315 ENDIF:codeurl
316 ENDIF:callseq
317 IFNOT:callseq
318 IF:codeurl
319 <a href="%codeurl%" target="source" class="srclink"><b>%name%</b>%params%</a>
320 ENDIF:codeurl
321 ENDIF:callseq
322 </a></td></tr>
323 </table>
324 IF:m_desc
325 <div class="description">
326 %m_desc%
327 </div>
328 ENDIF:m_desc
329 IF:aka
330 <div class="aka">
331 This method is also aliased as
332 START:aka
333 <a href="%aref%">%name%</a>
334 END:aka
335 </div>
336 ENDIF:aka
337 IF:sourcecode
338 <pre class="source">
339 %sourcecode%
340 </pre>
341 ENDIF:sourcecode
342 <hr>
343 END:methods
344 ENDIF:methods
345 END:method_list
346 ENDIF:method_list
347 }
348
349 =begin
350 =end
351
352 ########################## Source code ##########################
353
354 SRC_PAGE = %{
355 <html>
356 <head><title>%title%</title>
357 <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
358 <style type="text/css">
359 .ruby-comment { color: green; font-style: italic }
360 .ruby-constant { color: #4433aa; font-weight: bold; }
361 .ruby-identifier { color: #222222; }
362 .ruby-ivar { color: #2233dd; }
363 .ruby-keyword { color: #3333FF; font-weight: bold }
364 .ruby-node { color: #777777; }
365 .ruby-operator { color: #111111; }
366 .ruby-regexp { color: #662222; }
367 .ruby-value { color: #662222; font-style: italic }
368 .kw { color: #3333FF; font-weight: bold }
369 .cmt { color: green; font-style: italic }
370 .str { color: #662222; font-style: italic }
371 .re { color: #662222; }
372 </style>
373 </head>
374 <body bgcolor="white">
375 <pre>%code%</pre>
376 </body>
377 </html>
378 }
379
380 ########################## Index ################################
381
382 FR_INDEX_BODY = %{
383 !INCLUDE!
384 }
385
386 FILE_INDEX = %{
387 <html>
388 <head>
389 <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
390 <style>
391 <!--
392 body {
393 background-color: white;
394 font-family: #{FONTS};
395 font-size: 11px;
396 font-style: normal;
397 line-height: 14px;
398 color: #000040;
399 }
400 div.banner {
401 background: #aa0000;
402 color: white;
403 padding: 1;
404 margin: 0;
405 font-size: 90%;
406 font-weight: bold;
407 line-height: 1.1;
408 text-align: center;
409 width: 100%;
410 }
411
412 -->
413 </style>
414 <base target="docwin">
415 </head>
416 <body>
417 <div class="banner">%list_title%</div>
418 START:entries
419 <a href="%href%">%name%</a><br />
420 END:entries
421 </body></html>
422 }
423
424 CLASS_INDEX = FILE_INDEX
425 METHOD_INDEX = FILE_INDEX
426
427 INDEX = %{
428 <html>
429 <head>
430 <title>%title%</title>
431 <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
432 </head>
433
434 <frameset cols="20%,*">
435 <frameset rows="30%,70%">
436 <frame src="fr_file_index.html" title="Files" name="Files">
437 <frame src="fr_class_index.html" name="Classes">
438 </frameset>
439 IF:inline_source
440 <frame src="%initial_page%" name="docwin">
441 ENDIF:inline_source
442 IFNOT:inline_source
443 <frameset rows="80%,20%">
444 <frame src="%initial_page%" name="docwin">
445 <frame src="blank.html" name="source">
446 </frameset>
447 ENDIF:inline_source
448 <noframes>
449 <body bgcolor="white">
450 Click <a href="html/index.html">here</a> for a non-frames
451 version of this page.
452 </body>
453 </noframes>
454 </frameset>
455
456 </html>
457 }
458
459 # and a blank page to use as a target
460 BLANK = %{
461 <html><body bgcolor="white"></body></html>
462 }
463
464 def write_extra_pages
465 template = TemplatePage.new(BLANK)
466 File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
467 end
468
469 end
470 end

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26