jamis.rb 11 KB

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