Develop and Download Open Source Software

Browse Subversion Repository

Contents of /rdoc_template.rb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13 - (show annotations) (download)
Fri Apr 6 13:54:21 2007 UTC (16 years, 11 months ago) by bluedwarf
File size: 9929 byte(s)
Improvement of documentations.

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

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