Added v 0.2.2 snapshot.
[twitter4r-core.git] / config / rdoc_template.rb
blob8f44bf9712867cdafeef7ba37fe26449e30e1b88
1 module RDoc
2   module Page
4     FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif"
6     STYLE = <<CSS
7 a {
8   color: #ec008c;
9   text-decoration: none;
12 a:hover {
13   color: #ec008c;
14   text-decoration: underline;
17 body, td, p {
18   font-family: %fonts%;
19   background: #FFF;
20   color: #000;
21   margin: 0px;
22   font-size: small;
25 #content {
26   margin: 2em;
29 #description p {
30   margin-bottom: 0.5em;
33 .sectiontitle {
34   margin-top: 1em;
35   margin-bottom: 1em;
36   padding: 0.5em;
37   padding-left: 2em;
38   background: #f6f6ff;
39   color: #ec008c;
40   font-weight: bold;
41   border: 1px dotted black;
44 .attr-rw {
45   padding-left: 1em;
46   padding-right: 1em;
47   text-align: center;
48   color: #055;
51 .attr-name {
52   font-weight: bold;
55 .attr-desc {
58 .attr-value {
59   font-family: monospace;
62 .file-title-prefix {
63   font-size: large;
66 .file-title {
67   font-size: large;
68   font-weight: bold;
69   color: #ec008c;
72 .banner {
73   background: #eef;
74   color: #555;
75   border: 1px solid #444;
76   padding: 1em;
79 .banner td {
80   background: transparent;
83 h1 a, h2 a, .sectiontitle a, .banner a {
84   color: #ec008c;
87 h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover {
88   text-decoration: underline;
91 .dyn-source {
92   display: none;
93   background: #FFE;
94   color: #000;
95   border: 1px dotted black;
96   margin: 0.5em 2em 0.5em 2em;
97   padding: 0.5em;
100 .dyn-source .cmt {
101   color: #00F;
102   font-style: italic;
105 .dyn-source .kw {
106   color: #070;
107   font-weight: bold;
110 .method {
111   margin-left: 1em;
112   margin-right: 1em;
113   margin-bottom: 1em;
116 .description pre {
117   padding: 0.5em;
118   border: 1px dotted black;
119   background: #FFE;
122 .method .title {
123   font-family: monospace;
124   font-size: large;
125   border-bottom: 1px dashed black;
126   margin-bottom: 0.3em;
127   padding-bottom: 0.1em;
130 .method .description, .method .sourcecode {
131   margin-left: 1em;
134 .description p, .sourcecode p {
135   margin-bottom: 0.5em;
138 .method .sourcecode p.source-link {
139   text-indent: 0em;
140   margin-top: 0.5em;
143 .method .aka {
144   margin-top: 0.3em;
145   margin-left: 1em;
146   font-style: italic;
147   text-indent: 2em;
150 h1 {
151   padding: 1em;
152   border: 1px solid black;
153   font-size: x-large;
154   font-weight: bold;
155   color: #222;
156   background: #e9e9ff;
159 h2 {
160   padding: 0.5em 1em 0.5em 1em;
161   border: 1px solid black;
162   font-size: large;
163   font-weight: normal;
164   color: #444;
165   background: #e9e9ff;
168 h3, h4, h5, h6 {
169   padding: 0.2em 1em 0.2em 1em;
170   border: 1px dashed #000;
171   color: #555;
172   background: #f6f6ff;
175 .sourcecode > pre {
176   font-family: "Courier New", monospace;
177   padding: 0.5em;
178   border: 1px dotted #000;
179   color: #222;
180   background: #ffd;
183 .entries {
184   margin: 0.25em 1em 0 1em;
185   font-size: x-small;
187 a {
188   white-space: nowrap;
193     XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
194 <!DOCTYPE html 
195      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
196      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
199     HEADER = XHTML_PREAMBLE + <<ENDHEADER
200 <html>
201   <head>
202     <title>%title%</title>
203     <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
204     <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
205     <script language="JavaScript" type="text/javascript">
206     // <![CDATA[
208         function toggleSource( id )
209         {
210           var elem
211           var link
213           if( document.getElementById )
214           {
215             elem = document.getElementById( id )
216             link = document.getElementById( "l_" + id )
217           }
218           else if ( document.all )
219           {
220             elem = eval( "document.all." + id )
221             link = eval( "document.all.l_" + id )
222           }
223           else
224             return false;
226           if( elem.style.display == "block" )
227           {
228             elem.style.display = "none"
229             link.innerHTML = "show source"
230           }
231           else
232           {
233             elem.style.display = "block"
234             link.innerHTML = "hide source"
235           }
236         }
238         function openCode( url )
239         {
240           window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
241         }
242       // ]]>
243     </script>
244   </head>
246   <body>
247 ENDHEADER
249     FILE_PAGE = <<HTML
250 <table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>
251   <tr><td>
252     <table width="100%" border='0' cellpadding='0' cellspacing='0'><tr>
253       <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />%short_name%</td>
254       <td align="right">
255         <table border='0' cellspacing="0" cellpadding="2">
256           <tr>
257             <td>Path:</td>
258             <td>%full_path%
259 IF:cvsurl
260                                 &nbsp;(<a href="%cvsurl%">CVS</a>)
261 ENDIF:cvsurl
262             </td>
263           </tr>
264           <tr>
265             <td>Modified:</td>
266             <td>%dtm_modified%</td>
267           </tr>
268         </table>
269       </td></tr>
270     </table>
271   </td></tr>
272 </table><br>
273 HTML
275 ###################################################################
277     CLASS_PAGE = <<HTML
278 <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
279   <td class="file-title"><span class="file-title-prefix">%classmod%</span><br />%full_name%</td>
280   <td align="right">
281     <table cellspacing=0 cellpadding=2>
282       <tr valign="top">
283         <td>In:</td>
284         <td>
285 START:infiles
286 HREF:full_path_url:full_path:
287 IF:cvsurl
288 &nbsp;(<a href="%cvsurl%">CVS</a>)
289 ENDIF:cvsurl
290 END:infiles
291         </td>
292       </tr>
293 IF:parent
294     <tr>
295       <td>Parent:</td>
296       <td>
297 IF:par_url
298         <a href="%par_url%">
299 ENDIF:par_url
300 %parent%
301 IF:par_url
302          </a>
303 ENDIF:par_url
304      </td>
305    </tr>
306 ENDIF:parent
307          </table>
308         </td>
309         </tr>
310       </table>
311 HTML
313 ###################################################################
315     METHOD_LIST = <<HTML
316   <div id="content">
317 IF:diagram
318   <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center">
319     %diagram%
320   </td></tr></table>
321 ENDIF:diagram
323 IF:description
324   <div class="description">%description%</div>
325 ENDIF:description
327 IF:requires
328   <div class="sectiontitle">Required Files</div>
329   <ul>
330 START:requires
331   <li>HREF:aref:name:</li>
332 END:requires
333   </ul>
334 ENDIF:requires
336 IF:toc
337   <div class="sectiontitle">Contents</div>
338   <ul>
339 START:toc
340   <li><a href="#%href%">%secname%</a></li>
341 END:toc
342   </ul>
343 ENDIF:toc
345 IF:methods
346   <div class="sectiontitle">Methods</div>
347   <ul>
348 START:methods
349   <li>HREF:aref:name:</li>
350 END:methods
351   </ul>
352 ENDIF:methods
354 IF:includes
355 <div class="sectiontitle">Included Modules</div>
356 <ul>
357 START:includes
358   <li>HREF:aref:name:</li>
359 END:includes
360 </ul>
361 ENDIF:includes
363 START:sections
364 IF:sectitle
365 <div class="sectiontitle"><a name="%secsequence%">%sectitle%</a></div>
366 IF:seccomment
367 <div class="description">
368 %seccomment%
369 </div>
370 ENDIF:seccomment
371 ENDIF:sectitle
373 IF:classlist
374   <div class="sectiontitle">Classes and Modules</div>
375   %classlist%
376 ENDIF:classlist
378 IF:constants
379   <div class="sectiontitle">Constants</div>
380   <table border='0' cellpadding='5'>
381 START:constants
382   <tr valign='top'>
383     <td class="attr-name">%name%</td>
384     <td>=</td>
385     <td class="attr-value">%value%</td>
386   </tr>
387 IF:desc
388   <tr valign='top'>
389     <td>&nbsp;</td>
390     <td colspan="2" class="attr-desc">%desc%</td>
391   </tr>
392 ENDIF:desc
393 END:constants
394   </table>
395 ENDIF:constants
397 IF:attributes
398   <div class="sectiontitle">Attributes</div>
399   <table border='0' cellpadding='5'>
400 START:attributes
401   <tr valign='top'>
402     <td class='attr-rw'>
403 IF:rw
404 [%rw%]
405 ENDIF:rw
406     </td>
407     <td class='attr-name'>%name%</td>
408     <td class='attr-desc'>%a_desc%</td>
409   </tr>
410 END:attributes
411   </table>
412 ENDIF:attributes
414 IF:method_list
415 START:method_list
416 IF:methods
417 <div class="sectiontitle">%type% %category% methods</div>
418 START:methods
419 <div class="method">
420   <div class="title">
421 IF:callseq
422     <a name="%aref%"></a><b>%callseq%</b>
423 ENDIF:callseq
424 IFNOT:callseq
425     <a name="%aref%"></a><b>%name%</b>%params%
426 ENDIF:callseq
427 IF:codeurl
428 [ <a href="javascript:openCode('%codeurl%')">source</a> ]
429 ENDIF:codeurl
430   </div>
431 IF:m_desc
432   <div class="description">
433   %m_desc%
434   </div>
435 ENDIF:m_desc
436 IF:aka
437 <div class="aka">
438   This method is also aliased as
439 START:aka
440   <a href="%aref%">%name%</a>
441 END:aka
442 </div>
443 ENDIF:aka
444 IF:sourcecode
445 <div class="sourcecode">
446   <p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p>
447   <div id="%aref%_source" class="dyn-source">
448 <pre>
449 %sourcecode%
450 </pre>
451   </div>
452 </div>
453 ENDIF:sourcecode
454 </div>
455 END:methods
456 ENDIF:methods
457 END:method_list
458 ENDIF:method_list
459 END:sections
460 </div>
461 HTML
463     FOOTER = <<ENDFOOTER
464     <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
465     </script>
466     <script type="text/javascript">
467 _uacct = "UA-837842-4";
468 urchinTracker();
469     </script>
470   </body>
471 </html>
472 ENDFOOTER
474     BODY = HEADER + <<ENDBODY
475   !INCLUDE! <!-- banner header -->
477   <div id="bodyContent">
478     #{METHOD_LIST}
479   </div>
481   #{FOOTER}
482 ENDBODY
484 ########################## Source code ##########################
486     SRC_PAGE = XHTML_PREAMBLE + <<HTML
487 <html>
488 <head><title>%title%</title>
489 <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
490 <style>
491 .ruby-comment    { color: green; font-style: italic }
492 .ruby-constant   { color: #4433aa; font-weight: bold; }
493 .ruby-identifier { color: #222222;  }
494 .ruby-ivar       { color: #2233dd; }
495 .ruby-keyword    { color: #3333FF; font-weight: bold }
496 .ruby-node       { color: #777777; }
497 .ruby-operator   { color: #111111;  }
498 .ruby-regexp     { color: #662222; }
499 .ruby-value      { color: #662222; font-style: italic }
500   .kw { color: #3333FF; font-weight: bold }
501   .cmt { color: green; font-style: italic }
502   .str { color: #662222; font-style: italic }
503   .re  { color: #662222; }
504 </style>
505 </head>
506 <body bgcolor="white">
507 <pre>%code%</pre>
508 </body>
509 </html>
510 HTML
512 ########################## Index ################################
514     FR_INDEX_BODY = <<HTML
515 !INCLUDE!
516 HTML
518   FILE_INDEX = XHTML_PREAMBLE + <<HTML
519 <html>
520 <head>
521 <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
522 <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
523 <base target="docwin">
524 </head>
525 <body>
526 <div class="banner">%list_title%</div>
527 <div class="entries">
528 START:entries
529 <a href="%href%">%name%</a><br>
530 END:entries
531 </div>
532 </body></html>
533 HTML
535     CLASS_INDEX = FILE_INDEX
536     METHOD_INDEX = FILE_INDEX
538     INDEX = XHTML_PREAMBLE + <<HTML
539 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
540 <head>
541   <title>%title%</title>
542   <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
543 </head>
545 <frameset cols="20%,*">
546     <frameset rows="15%,35%,50%">
547         <frame src="fr_file_index.html"   title="Files" name="Files" />
548         <frame src="fr_class_index.html"  name="Classes" />
549         <frame src="fr_method_index.html" name="Methods" />
550     </frameset>
551 IF:inline_source
552       <frame  src="%initial_page%" name="docwin">
553 ENDIF:inline_source
554 IFNOT:inline_source
555     <frameset rows="80%,20%">
556       <frame  src="%initial_page%" name="docwin">
557       <frame  src="blank.html" name="source">
558     </frameset>
559 ENDIF:inline_source
560     <noframes>
561           <body bgcolor="white">
562             Click <a href="html/index.html">here</a> for a non-frames
563             version of this page.
564           </body>
565     </noframes>
566 </frameset>
568 </html>
569 HTML
570   end