source: extensions/gsdl-video/trunk/installed/cmdline/lib/ruby/1.8/rdoc/generators/template/html/html.rb@ 18425

Last change on this file since 18425 was 18425, checked in by davidb, 15 years ago

Video extension to Greenstone

File size: 15.8 KB
Line 
1#
2# = CSS2 RDoc HTML template
3#
4# This is a template for RDoc that uses XHTML 1.0 Transitional and dictates a
5# bit more of the appearance of the output to cascading stylesheets than the
6# default. It was designed for clean inline code display, and uses DHTMl to
7# toggle the visbility of each method's source with each click on the '[source]'
8# link.
9#
10# == Authors
11#
12# * Michael Granger <[email protected]>
13#
14# Copyright (c) 2002, 2003 The FaerieMUD Consortium. Some rights reserved.
15#
16# This work is licensed under the Creative Commons Attribution License. To view
17# a copy of this license, visit http://creativecommons.org/licenses/by/1.0/ or
18# send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
19# 94305, USA.
20#
21
22module RDoc
23 module Page
24
25 FONTS = "Verdana,Arial,Helvetica,sans-serif"
26
27STYLE = %{
28body {
29 font-family: Verdana,Arial,Helvetica,sans-serif;
30 font-size: 90%;
31 margin: 0;
32 margin-left: 40px;
33 padding: 0;
34 background: white;
35}
36
37h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
38h1 { font-size: 150%; }
39h2,h3,h4 { margin-top: 1em; }
40
41a { background: #eef; color: #039; text-decoration: none; }
42a:hover { background: #039; color: #eef; }
43
44/* Override the base stylesheet's Anchor inside a table cell */
45td > a {
46 background: transparent;
47 color: #039;
48 text-decoration: none;
49}
50
51/* and inside a section title */
52.section-title > a {
53 background: transparent;
54 color: #eee;
55 text-decoration: none;
56}
57
58/* === Structural elements =================================== */
59
60div#index {
61 margin: 0;
62 margin-left: -40px;
63 padding: 0;
64 font-size: 90%;
65}
66
67
68div#index a {
69 margin-left: 0.7em;
70}
71
72div#index .section-bar {
73 margin-left: 0px;
74 padding-left: 0.7em;
75 background: #ccc;
76 font-size: small;
77}
78
79
80div#classHeader, div#fileHeader {
81 width: auto;
82 color: white;
83 padding: 0.5em 1.5em 0.5em 1.5em;
84 margin: 0;
85 margin-left: -40px;
86 border-bottom: 3px solid #006;
87}
88
89div#classHeader a, div#fileHeader a {
90 background: inherit;
91 color: white;
92}
93
94div#classHeader td, div#fileHeader td {
95 background: inherit;
96 color: white;
97}
98
99
100div#fileHeader {
101 background: #057;
102}
103
104div#classHeader {
105 background: #048;
106}
107
108
109.class-name-in-header {
110 font-size: 180%;
111 font-weight: bold;
112}
113
114
115div#bodyContent {
116 padding: 0 1.5em 0 1.5em;
117}
118
119div#description {
120 padding: 0.5em 1.5em;
121 background: #efefef;
122 border: 1px dotted #999;
123}
124
125div#description h1,h2,h3,h4,h5,h6 {
126 color: #125;;
127 background: transparent;
128}
129
130div#validator-badges {
131 text-align: center;
132}
133div#validator-badges img { border: 0; }
134
135div#copyright {
136 color: #333;
137 background: #efefef;
138 font: 0.75em sans-serif;
139 margin-top: 5em;
140 margin-bottom: 0;
141 padding: 0.5em 2em;
142}
143
144
145/* === Classes =================================== */
146
147table.header-table {
148 color: white;
149 font-size: small;
150}
151
152.type-note {
153 font-size: small;
154 color: #DEDEDE;
155}
156
157.xxsection-bar {
158 background: #eee;
159 color: #333;
160 padding: 3px;
161}
162
163.section-bar {
164 color: #333;
165 border-bottom: 1px solid #999;
166 margin-left: -20px;
167}
168
169
170.section-title {
171 background: #79a;
172 color: #eee;
173 padding: 3px;
174 margin-top: 2em;
175 margin-left: -30px;
176 border: 1px solid #999;
177}
178
179.top-aligned-row { vertical-align: top }
180.bottom-aligned-row { vertical-align: bottom }
181
182/* --- Context section classes ----------------------- */
183
184.context-row { }
185.context-item-name { font-family: monospace; font-weight: bold; color: black; }
186.context-item-value { font-size: small; color: #448; }
187.context-item-desc { color: #333; padding-left: 2em; }
188
189/* --- Method classes -------------------------- */
190.method-detail {
191 background: #efefef;
192 padding: 0;
193 margin-top: 0.5em;
194 margin-bottom: 1em;
195 border: 1px dotted #ccc;
196}
197.method-heading {
198 color: black;
199 background: #ccc;
200 border-bottom: 1px solid #666;
201 padding: 0.2em 0.5em 0 0.5em;
202}
203.method-signature { color: black; background: inherit; }
204.method-name { font-weight: bold; }
205.method-args { font-style: italic; }
206.method-description { padding: 0 0.5em 0 0.5em; }
207
208/* --- Source code sections -------------------- */
209
210a.source-toggle { font-size: 90%; }
211div.method-source-code {
212 background: #262626;
213 color: #ffdead;
214 margin: 1em;
215 padding: 0.5em;
216 border: 1px dashed #999;
217 overflow: hidden;
218}
219
220div.method-source-code pre { color: #ffdead; overflow: hidden; }
221
222/* --- Ruby keyword styles --------------------- */
223
224.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
225
226.ruby-constant { color: #7fffd4; background: transparent; }
227.ruby-keyword { color: #00ffff; background: transparent; }
228.ruby-ivar { color: #eedd82; background: transparent; }
229.ruby-operator { color: #00ffee; background: transparent; }
230.ruby-identifier { color: #ffdead; background: transparent; }
231.ruby-node { color: #ffa07a; background: transparent; }
232.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
233.ruby-regexp { color: #ffa07a; background: transparent; }
234.ruby-value { color: #7fffd4; background: transparent; }
235}
236
237
238#####################################################################
239### H E A D E R T E M P L A T E
240#####################################################################
241
242XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
243<!DOCTYPE html
244 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
245 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
246}
247
248HEADER = XHTML_PREAMBLE + %{
249<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
250<head>
251 <title>%title%</title>
252 <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
253 <meta http-equiv="Content-Script-Type" content="text/javascript" />
254 <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
255 <script type="text/javascript">
256 // <![CDATA[
257
258 function popupCode( url ) {
259 window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
260 }
261
262 function toggleCode( id ) {
263 if ( document.getElementById )
264 elem = document.getElementById( id );
265 else if ( document.all )
266 elem = eval( "document.all." + id );
267 else
268 return false;
269
270 elemStyle = elem.style;
271
272 if ( elemStyle.display != "block" ) {
273 elemStyle.display = "block"
274 } else {
275 elemStyle.display = "none"
276 }
277
278 return true;
279 }
280
281 // Make codeblocks hidden by default
282 document.writeln( "<style type=\\"text/css\\">div.method-source-code { display: none }</style>" )
283
284 // ]]>
285 </script>
286
287</head>
288<body>
289}
290
291
292#####################################################################
293### C O N T E X T C O N T E N T T E M P L A T E
294#####################################################################
295
296CONTEXT_CONTENT = %{
297}
298
299
300#####################################################################
301### F O O T E R T E M P L A T E
302#####################################################################
303FOOTER = %{
304<div id="validator-badges">
305 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
306</div>
307
308</body>
309</html>
310}
311
312
313#####################################################################
314### F I L E P A G E H E A D E R T E M P L A T E
315#####################################################################
316
317FILE_PAGE = %{
318 <div id="fileHeader">
319 <h1>%short_name%</h1>
320 <table class="header-table">
321 <tr class="top-aligned-row">
322 <td><strong>Path:</strong></td>
323 <td>%full_path%
324IF:cvsurl
325 &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
326ENDIF:cvsurl
327 </td>
328 </tr>
329 <tr class="top-aligned-row">
330 <td><strong>Last Update:</strong></td>
331 <td>%dtm_modified%</td>
332 </tr>
333 </table>
334 </div>
335}
336
337
338#####################################################################
339### C L A S S P A G E H E A D E R T E M P L A T E
340#####################################################################
341
342CLASS_PAGE = %{
343 <div id="classHeader">
344 <table class="header-table">
345 <tr class="top-aligned-row">
346 <td><strong>%classmod%</strong></td>
347 <td class="class-name-in-header">%full_name%</td>
348 </tr>
349 <tr class="top-aligned-row">
350 <td><strong>In:</strong></td>
351 <td>
352START:infiles
353IF:full_path_url
354 <a href="%full_path_url%">
355ENDIF:full_path_url
356 %full_path%
357IF:full_path_url
358 </a>
359ENDIF:full_path_url
360IF:cvsurl
361 &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
362ENDIF:cvsurl
363 <br />
364END:infiles
365 </td>
366 </tr>
367
368IF:parent
369 <tr class="top-aligned-row">
370 <td><strong>Parent:</strong></td>
371 <td>
372IF:par_url
373 <a href="%par_url%">
374ENDIF:par_url
375 %parent%
376IF:par_url
377 </a>
378ENDIF:par_url
379 </td>
380 </tr>
381ENDIF:parent
382 </table>
383 </div>
384}
385
386
387#####################################################################
388### M E T H O D L I S T T E M P L A T E
389#####################################################################
390
391METHOD_LIST = %{
392
393 <div id="contextContent">
394IF:diagram
395 <div id="diagram">
396 %diagram%
397 </div>
398ENDIF:diagram
399
400IF:description
401 <div id="description">
402 %description%
403 </div>
404ENDIF:description
405
406IF:requires
407 <div id="requires-list">
408 <h3 class="section-bar">Required files</h3>
409
410 <div class="name-list">
411START:requires
412 HREF:aref:name:&nbsp;&nbsp;
413END:requires
414 </div>
415 </div>
416ENDIF:requires
417
418IF:toc
419 <div id="contents-list">
420 <h3 class="section-bar">Contents</h3>
421 <ul>
422START:toc
423 <li><a href="#%href%">%secname%</a></li>
424END:toc
425 </ul>
426ENDIF:toc
427 </div>
428
429IF:methods
430 <div id="method-list">
431 <h3 class="section-bar">Methods</h3>
432
433 <div class="name-list">
434START:methods
435 HREF:aref:name:&nbsp;&nbsp;
436END:methods
437 </div>
438 </div>
439ENDIF:methods
440
441 </div>
442
443
444 <!-- if includes -->
445IF:includes
446 <div id="includes">
447 <h3 class="section-bar">Included Modules</h3>
448
449 <div id="includes-list">
450START:includes
451 <span class="include-name">HREF:aref:name:</span>
452END:includes
453 </div>
454 </div>
455ENDIF:includes
456
457START:sections
458 <div id="section">
459IF:sectitle
460 <h2 class="section-title"><a name="%secsequence%">%sectitle%</a></h2>
461IF:seccomment
462 <div class="section-comment">
463 %seccomment%
464 </div>
465ENDIF:seccomment
466ENDIF:sectitle
467
468IF:classlist
469 <div id="class-list">
470 <h3 class="section-bar">Classes and Modules</h3>
471
472 %classlist%
473 </div>
474ENDIF:classlist
475
476IF:constants
477 <div id="constants-list">
478 <h3 class="section-bar">Constants</h3>
479
480 <div class="name-list">
481 <table summary="Constants">
482START:constants
483 <tr class="top-aligned-row context-row">
484 <td class="context-item-name">%name%</td>
485 <td>=</td>
486 <td class="context-item-value">%value%</td>
487IF:desc
488 <td width="3em">&nbsp;</td>
489 <td class="context-item-desc">%desc%</td>
490ENDIF:desc
491 </tr>
492END:constants
493 </table>
494 </div>
495 </div>
496ENDIF:constants
497
498IF:aliases
499 <div id="aliases-list">
500 <h3 class="section-bar">External Aliases</h3>
501
502 <div class="name-list">
503 <table summary="aliases">
504START:aliases
505 <tr class="top-aligned-row context-row">
506 <td class="context-item-name">%old_name%</td>
507 <td>-&gt;</td>
508 <td class="context-item-value">%new_name%</td>
509 </tr>
510IF:desc
511 <tr class="top-aligned-row context-row">
512 <td>&nbsp;</td>
513 <td colspan="2" class="context-item-desc">%desc%</td>
514 </tr>
515ENDIF:desc
516END:aliases
517 </table>
518 </div>
519 </div>
520ENDIF:aliases
521
522
523IF:attributes
524 <div id="attribute-list">
525 <h3 class="section-bar">Attributes</h3>
526
527 <div class="name-list">
528 <table>
529START:attributes
530 <tr class="top-aligned-row context-row">
531 <td class="context-item-name">%name%</td>
532IF:rw
533 <td class="context-item-value">&nbsp;[%rw%]&nbsp;</td>
534ENDIF:rw
535IFNOT:rw
536 <td class="context-item-value">&nbsp;&nbsp;</td>
537ENDIF:rw
538 <td class="context-item-desc">%a_desc%</td>
539 </tr>
540END:attributes
541 </table>
542 </div>
543 </div>
544ENDIF:attributes
545
546
547
548 <!-- if method_list -->
549IF:method_list
550 <div id="methods">
551START:method_list
552IF:methods
553 <h3 class="section-bar">%type% %category% methods</h3>
554
555START:methods
556 <div id="method-%aref%" class="method-detail">
557 <a name="%aref%"></a>
558
559 <div class="method-heading">
560IF:codeurl
561 <a href="%codeurl%" target="Code" class="method-signature"
562 onclick="popupCode('%codeurl%');return false;">
563ENDIF:codeurl
564IF:sourcecode
565 <a href="#%aref%" class="method-signature">
566ENDIF:sourcecode
567IF:callseq
568 <span class="method-name">%callseq%</span>
569ENDIF:callseq
570IFNOT:callseq
571 <span class="method-name">%name%</span><span class="method-args">%params%</span>
572ENDIF:callseq
573IF:codeurl
574 </a>
575ENDIF:codeurl
576IF:sourcecode
577 </a>
578ENDIF:sourcecode
579 </div>
580
581 <div class="method-description">
582IF:m_desc
583 %m_desc%
584ENDIF:m_desc
585IF:sourcecode
586 <p><a class="source-toggle" href="#"
587 onclick="toggleCode('%aref%-source');return false;">[Source]</a></p>
588 <div class="method-source-code" id="%aref%-source">
589<pre>
590%sourcecode%
591</pre>
592 </div>
593ENDIF:sourcecode
594 </div>
595 </div>
596
597END:methods
598ENDIF:methods
599END:method_list
600
601 </div>
602ENDIF:method_list
603END:sections
604}
605
606
607#####################################################################
608### B O D Y T E M P L A T E
609#####################################################################
610
611BODY = HEADER + %{
612
613!INCLUDE! <!-- banner header -->
614
615 <div id="bodyContent">
616
617} + METHOD_LIST + %{
618
619 </div>
620
621} + FOOTER
622
623
624
625#####################################################################
626### S O U R C E C O D E T E M P L A T E
627#####################################################################
628
629SRC_PAGE = XHTML_PREAMBLE + %{
630<html>
631<head>
632 <title>%title%</title>
633 <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
634 <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
635</head>
636<body class="standalone-code">
637 <pre>%code%</pre>
638</body>
639</html>
640}
641
642
643#####################################################################
644### I N D E X F I L E T E M P L A T E S
645#####################################################################
646
647FR_INDEX_BODY = %{
648!INCLUDE!
649}
650
651FILE_INDEX = XHTML_PREAMBLE + %{
652<!--
653
654 %list_title%
655
656 -->
657<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
658<head>
659 <title>%list_title%</title>
660 <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
661 <link rel="stylesheet" href="%style_url%" type="text/css" />
662 <base target="docwin" />
663</head>
664<body>
665<div id="index">
666 <h1 class="section-bar">%list_title%</h1>
667 <div id="index-entries">
668START:entries
669 <a href="%href%">%name%</a><br />
670END:entries
671 </div>
672</div>
673</body>
674</html>
675}
676
677CLASS_INDEX = FILE_INDEX
678METHOD_INDEX = FILE_INDEX
679
680INDEX = %{<?xml version="1.0" encoding="%charset%"?>
681<!DOCTYPE html
682 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
683 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
684
685<!--
686
687 %title%
688
689 -->
690<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
691<head>
692 <title>%title%</title>
693 <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
694</head>
695<frameset rows="20%, 80%">
696 <frameset cols="25%,35%,45%">
697 <frame src="fr_file_index.html" title="Files" name="Files" />
698 <frame src="fr_class_index.html" name="Classes" />
699 <frame src="fr_method_index.html" name="Methods" />
700 </frameset>
701 <frame src="%initial_page%" name="docwin" />
702</frameset>
703</html>
704}
705
706
707
708 end # module Page
709end # class RDoc
710
711require 'rdoc/generators/template/html/one_page_html'
Note: See TracBrowser for help on using the repository browser.