vlaah 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/doc/template.rb ADDED
@@ -0,0 +1,744 @@
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 <ged@FaerieMUD.org>
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
+
22
+ module RDoc
23
+ module Page
24
+
25
+ FONTS = "Verdana,Arial,Helvetica,sans-serif"
26
+
27
+ STYLE = %{
28
+ body {
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
+
37
+ h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
38
+ h1 { font-size: 150%; }
39
+ h2,h3,h4 { margin-top: 1em; }
40
+
41
+ a { background: #eef; color: #039; text-decoration: none; }
42
+ a:hover { background: #039; color: #eef; }
43
+
44
+ /* Override the base stylesheet's Anchor inside a table cell */
45
+ td > 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
+
60
+ div#index {
61
+ margin: 0;
62
+ margin-left: -40px;
63
+ padding: 0;
64
+ font-size: 90%;
65
+ }
66
+
67
+
68
+ div#index a {
69
+ margin-left: 0.7em;
70
+ }
71
+
72
+ div#index .section-bar {
73
+ margin-left: 0px;
74
+ padding-left: 0.7em;
75
+ background: #ccc;
76
+ font-size: small;
77
+ }
78
+
79
+
80
+ div#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
+
89
+ div#classHeader a, div#fileHeader a {
90
+ background: inherit;
91
+ color: white;
92
+ }
93
+
94
+ div#classHeader td, div#fileHeader td {
95
+ background: inherit;
96
+ color: white;
97
+ }
98
+
99
+
100
+ div#fileHeader {
101
+ background: #057;
102
+ }
103
+
104
+ div#classHeader {
105
+ background: #048;
106
+ }
107
+
108
+
109
+ .class-name-in-header {
110
+ font-size: 180%;
111
+ font-weight: bold;
112
+ }
113
+
114
+
115
+ div#bodyContent {
116
+ padding: 0 1.5em 0 1.5em;
117
+ }
118
+
119
+ div#description {
120
+ padding: 0.5em 1.5em;
121
+ background: #efefef;
122
+ border: 1px dotted #999;
123
+ }
124
+
125
+ div#description h1,h2,h3,h4,h5,h6 {
126
+ color: #125;;
127
+ background: transparent;
128
+ }
129
+
130
+ div#validator-badges {
131
+ text-align: center;
132
+ }
133
+ div#validator-badges img { border: 0; }
134
+
135
+ div#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
+
147
+ table.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
+
210
+ a.source-toggle { font-size: 90%; }
211
+ div.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
+
220
+ div.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
+
242
+ XHTML_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
+
248
+ HEADER = 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
+
296
+ CONTEXT_CONTENT = %{
297
+ }
298
+
299
+
300
+ #####################################################################
301
+ ### F O O T E R T E M P L A T E
302
+ #####################################################################
303
+ FOOTER = %{
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
+
317
+ FILE_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%
324
+ IF:cvsurl
325
+ &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
326
+ ENDIF: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
+
342
+ CLASS_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>
352
+ START:infiles
353
+ IF:full_path_url
354
+ <a href="%full_path_url%">
355
+ ENDIF:full_path_url
356
+ %full_path%
357
+ IF:full_path_url
358
+ </a>
359
+ ENDIF:full_path_url
360
+ IF:cvsurl
361
+ &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
362
+ ENDIF:cvsurl
363
+ <br />
364
+ END:infiles
365
+ </td>
366
+ </tr>
367
+
368
+ IF:parent
369
+ <tr class="top-aligned-row">
370
+ <td><strong>Parent:</strong></td>
371
+ <td>
372
+ IF:par_url
373
+ <a href="%par_url%">
374
+ ENDIF:par_url
375
+ %parent%
376
+ IF:par_url
377
+ </a>
378
+ ENDIF:par_url
379
+ </td>
380
+ </tr>
381
+ ENDIF: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
+
391
+ METHOD_LIST = %{
392
+
393
+ <div id="contextContent">
394
+ IF:diagram
395
+ <div id="diagram">
396
+ %diagram%
397
+ </div>
398
+ ENDIF:diagram
399
+
400
+ IF:description
401
+ <div id="description">
402
+ %description%
403
+ </div>
404
+ ENDIF:description
405
+
406
+ IF:requires
407
+ <div id="requires-list">
408
+ <h3 class="section-bar">Required files</h3>
409
+
410
+ <div class="name-list">
411
+ START:requires
412
+ HREF:aref:name:&nbsp;&nbsp;
413
+ END:requires
414
+ </div>
415
+ </div>
416
+ ENDIF:requires
417
+
418
+ IF:toc
419
+ <div id="contents-list">
420
+ <h3 class="section-bar">Contents</h3>
421
+ <ul>
422
+ START:toc
423
+ <li><a href="#%href%">%secname%</a></li>
424
+ END:toc
425
+ </ul>
426
+ ENDIF:toc
427
+ </div>
428
+
429
+ IF:methods
430
+ <div id="method-list">
431
+ <h3 class="section-bar">Methods</h3>
432
+
433
+ <div class="name-list">
434
+ START:methods
435
+ HREF:aref:name:&nbsp;&nbsp;
436
+ END:methods
437
+ </div>
438
+ </div>
439
+ ENDIF:methods
440
+
441
+ </div>
442
+
443
+
444
+ <!-- if includes -->
445
+ IF:includes
446
+ <div id="includes">
447
+ <h3 class="section-bar">Included Modules</h3>
448
+
449
+ <div id="includes-list">
450
+ START:includes
451
+ <span class="include-name">HREF:aref:name:</span>
452
+ END:includes
453
+ </div>
454
+ </div>
455
+ ENDIF:includes
456
+
457
+ START:sections
458
+ <div id="section">
459
+ IF:sectitle
460
+ <h2 class="section-title"><a name="%secsequence%">%sectitle%</a></h2>
461
+ IF:seccomment
462
+ <div class="section-comment">
463
+ %seccomment%
464
+ </div>
465
+ ENDIF:seccomment
466
+ ENDIF:sectitle
467
+
468
+ IF:classlist
469
+ <div id="class-list">
470
+ <h3 class="section-bar">Classes and Modules</h3>
471
+
472
+ %classlist%
473
+ </div>
474
+ ENDIF:classlist
475
+
476
+ IF:constants
477
+ <div id="constants-list">
478
+ <h3 class="section-bar">Constants</h3>
479
+
480
+ <div class="name-list">
481
+ <table summary="Constants">
482
+ START: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>
487
+ IF:desc
488
+ <td width="3em">&nbsp;</td>
489
+ <td class="context-item-desc">%desc%</td>
490
+ ENDIF:desc
491
+ </tr>
492
+ END:constants
493
+ </table>
494
+ </div>
495
+ </div>
496
+ ENDIF:constants
497
+
498
+ IF:aliases
499
+ <div id="aliases-list">
500
+ <h3 class="section-bar">External Aliases</h3>
501
+
502
+ <div class="name-list">
503
+ <table summary="aliases">
504
+ START: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>
510
+ IF: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>
515
+ ENDIF:desc
516
+ END:aliases
517
+ </table>
518
+ </div>
519
+ </div>
520
+ ENDIF:aliases
521
+
522
+
523
+ IF:attributes
524
+ <div id="attribute-list">
525
+ <h3 class="section-bar">Attributes</h3>
526
+
527
+ <div class="name-list">
528
+ <table>
529
+ START:attributes
530
+ <tr class="top-aligned-row context-row">
531
+ <td class="context-item-name">%name%</td>
532
+ IF:rw
533
+ <td class="context-item-value">&nbsp;[%rw%]&nbsp;</td>
534
+ ENDIF:rw
535
+ IFNOT:rw
536
+ <td class="context-item-value">&nbsp;&nbsp;</td>
537
+ ENDIF:rw
538
+ <td class="context-item-desc">%a_desc%</td>
539
+ </tr>
540
+ END:attributes
541
+ </table>
542
+ </div>
543
+ </div>
544
+ ENDIF:attributes
545
+
546
+
547
+
548
+ <!-- if method_list -->
549
+ IF:method_list
550
+ <div id="methods">
551
+ START:method_list
552
+ IF:methods
553
+ <h3 class="section-bar">%type% %category% methods</h3>
554
+
555
+ START:methods
556
+ <div id="method-%aref%" class="method-detail">
557
+ <a name="%aref%"></a>
558
+
559
+ <div class="method-heading">
560
+ IF:codeurl
561
+ <a href="%codeurl%" target="Code" class="method-signature"
562
+ onclick="popupCode('%codeurl%');return false;">
563
+ ENDIF:codeurl
564
+ IF:sourcecode
565
+ <a href="#%aref%" class="method-signature">
566
+ ENDIF:sourcecode
567
+ IF:callseq
568
+ <span class="method-name">%callseq%</span>
569
+ ENDIF:callseq
570
+ IFNOT:callseq
571
+ <span class="method-name">%name%</span><span class="method-args">%params%</span>
572
+ ENDIF:callseq
573
+ IF:codeurl
574
+ </a>
575
+ ENDIF:codeurl
576
+ IF:sourcecode
577
+ </a>
578
+ ENDIF:sourcecode
579
+ </div>
580
+
581
+ <div class="method-description">
582
+ IF:m_desc
583
+ %m_desc%
584
+ ENDIF:m_desc
585
+ IF: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>
593
+ ENDIF:sourcecode
594
+ </div>
595
+ </div>
596
+
597
+ END:methods
598
+ ENDIF:methods
599
+ END:method_list
600
+
601
+ </div>
602
+ ENDIF:method_list
603
+ END:sections
604
+ }
605
+
606
+
607
+ #####################################################################
608
+ ### B O D Y T E M P L A T E
609
+ #####################################################################
610
+
611
+ BODY = 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
+
629
+ SRC_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
+
647
+ FR_INDEX_BODY = %{
648
+ !INCLUDE!
649
+ }
650
+
651
+ FILE_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">
668
+ START:entries
669
+ <a href="%href%">%name%</a><br />
670
+ END:entries
671
+ </div>
672
+ </div>
673
+ </body>
674
+ </html>
675
+ }
676
+
677
+ CLASS_INDEX = FILE_INDEX
678
+ METHOD_INDEX = FILE_INDEX
679
+
680
+ INDEX = %{<?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="44, 20%, 80%">
696
+ <frame src="http://static.vlaah.com/etc/api-header.html" name="navigator" noresize="noresize" scrolling="no" />
697
+ <frameset cols="25%,35%,45%">
698
+ <frame src="fr_file_index.html" title="Files" name="Files" />
699
+ <frame src="fr_class_index.html" name="Classes" />
700
+ <frame src="fr_method_index.html" name="Methods" />
701
+ </frameset>
702
+ <frame src="%initial_page%" name="docwin" />
703
+ </frameset>
704
+ </html>
705
+ }
706
+
707
+
708
+ #####################################################################
709
+ ### N A V I G A T O R T E M P L A T E
710
+ #####################################################################
711
+
712
+ NVT_PAGE = XHTML_PREAMBLE + %{
713
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
714
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
715
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
716
+ <head>
717
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=%charset%" />
718
+ <title>%title%</title>
719
+ <style type="text/css">
720
+ /* <![CDATA[ */
721
+ body {
722
+ margin: 0;
723
+ padding: 10px;
724
+ }
725
+ .to-vlaah { float: left; margin-right: 10px; }
726
+ h1 {
727
+ font-size: 20px; line-height: 24px; color: #333;
728
+ margin: 0; padding: 0;
729
+ }
730
+ /* ]]> */
731
+ </style>
732
+ </head>
733
+ <body>
734
+ <div class="to-vlaah"><a href="http://vlaah.com/"><img src="http://static.vlaah.com/images/logos/logo_nopng.gif" alt="VLAAH" /></a></div>
735
+ <h1>Ruby</h1>
736
+ </body>
737
+ </html>
738
+ }
739
+
740
+
741
+ end # module Page
742
+ end # class RDoc
743
+
744
+ require 'rdoc/generators/template/html/one_page_html'