/tools/Ruby/lib/ruby/1.8/rdoc/generators/template/html/hefss.rb

http://github.com/agross/netopenspace · Ruby · 418 lines · 354 code · 55 blank · 9 comment · 1 complexity · 61bcaacc3566f9f4ab6e4f48b23383ca MD5 · raw file

  1. module RDoc
  2. module Page
  3. FONTS = "Verdana, Arial, Helvetica, sans-serif"
  4. STYLE = %{
  5. body,p { font-family: Verdana, Arial, Helvetica, sans-serif;
  6. color: #000040; background: #BBBBBB;
  7. }
  8. td { font-family: Verdana, Arial, Helvetica, sans-serif;
  9. color: #000040;
  10. }
  11. .attr-rw { font-size: small; color: #444488 }
  12. .title-row {color: #eeeeff;
  13. background: #BBBBDD;
  14. }
  15. .big-title-font { color: white;
  16. font-family: Verdana, Arial, Helvetica, sans-serif;
  17. font-size: large;
  18. height: 50px}
  19. .small-title-font { color: purple;
  20. font-family: Verdana, Arial, Helvetica, sans-serif;
  21. font-size: small; }
  22. .aqua { color: purple }
  23. .method-name, attr-name {
  24. font-family: monospace; font-weight: bold;
  25. }
  26. .tablesubtitle {
  27. width: 100%;
  28. margin-top: 1ex;
  29. margin-bottom: .5ex;
  30. padding: 5px 0px 5px 20px;
  31. font-size: large;
  32. color: purple;
  33. background: #BBBBCC;
  34. }
  35. .tablesubsubtitle {
  36. width: 100%;
  37. margin-top: 1ex;
  38. margin-bottom: .5ex;
  39. padding: 5px 0px 5px 20px;
  40. font-size: medium;
  41. color: white;
  42. background: #BBBBCC;
  43. }
  44. .name-list {
  45. font-family: monospace;
  46. margin-left: 40px;
  47. margin-bottom: 2ex;
  48. line-height: 140%;
  49. }
  50. .description {
  51. margin-left: 40px;
  52. margin-bottom: 2ex;
  53. line-height: 140%;
  54. }
  55. .methodtitle {
  56. font-size: medium;
  57. text_decoration: none;
  58. padding: 3px 3px 3px 20px;
  59. color: #0000AA;
  60. }
  61. .column-title {
  62. font-size: medium;
  63. font-weight: bold;
  64. text_decoration: none;
  65. padding: 3px 3px 3px 20px;
  66. color: #3333CC;
  67. }
  68. .variable-name {
  69. font-family: monospace;
  70. font-size: medium;
  71. text_decoration: none;
  72. padding: 3px 3px 3px 20px;
  73. color: #0000AA;
  74. }
  75. .row-name {
  76. font-size: medium;
  77. font-weight: medium;
  78. font-family: monospace;
  79. text_decoration: none;
  80. padding: 3px 3px 3px 20px;
  81. }
  82. .paramsig {
  83. font-size: small;
  84. }
  85. .srcbut { float: right }
  86. }
  87. ############################################################################
  88. BODY = %{
  89. <html><head>
  90. <title>%title%</title>
  91. <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
  92. <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
  93. <script type="text/javascript" language="JavaScript">
  94. <!--
  95. function popCode(url) {
  96. parent.frames.source.location = url
  97. }
  98. //-->
  99. </script>
  100. </head>
  101. <body bgcolor="#BBBBBB">
  102. !INCLUDE! <!-- banner header -->
  103. IF:diagram
  104. <table width="100%"><tr><td align="center">
  105. %diagram%
  106. </td></tr></table>
  107. ENDIF:diagram
  108. IF:description
  109. <div class="description">%description%</div>
  110. ENDIF:description
  111. IF:requires
  112. <table cellpadding="5" width="100%">
  113. <tr><td class="tablesubtitle">Required files</td></tr>
  114. </table><br />
  115. <div class="name-list">
  116. START:requires
  117. HREF:aref:name:
  118. END:requires
  119. ENDIF:requires
  120. </div>
  121. IF:methods
  122. <table cellpadding="5" width="100%">
  123. <tr><td class="tablesubtitle">Subroutines and Functions</td></tr>
  124. </table><br />
  125. <div class="name-list">
  126. START:methods
  127. HREF:aref:name:,
  128. END:methods
  129. </div>
  130. ENDIF:methods
  131. IF:attributes
  132. <table cellpadding="5" width="100%">
  133. <tr><td class="tablesubtitle">Arguments</td></tr>
  134. </table><br />
  135. <table cellspacing="5">
  136. START:attributes
  137. <tr valign="top">
  138. IF:rw
  139. <td align="center" class="attr-rw">&nbsp;[%rw%]&nbsp;</td>
  140. ENDIF:rw
  141. IFNOT:rw
  142. <td></td>
  143. ENDIF:rw
  144. <td class="attr-name">%name%</td>
  145. <td>%a_desc%</td>
  146. </tr>
  147. END:attributes
  148. </table>
  149. ENDIF:attributes
  150. IF:classlist
  151. <table cellpadding="5" width="100%">
  152. <tr><td class="tablesubtitle">Modules</td></tr>
  153. </table><br />
  154. %classlist%<br />
  155. ENDIF:classlist
  156. !INCLUDE! <!-- method descriptions -->
  157. </body>
  158. </html>
  159. }
  160. ###############################################################################
  161. FILE_PAGE = <<_FILE_PAGE_
  162. <table width="100%">
  163. <tr class="title-row">
  164. <td><table width="100%"><tr>
  165. <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font>%short_name%</td>
  166. <td align="right"><table cellspacing="0" cellpadding="2">
  167. <tr>
  168. <td class="small-title-font">Path:</td>
  169. <td class="small-title-font">%full_path%
  170. IF:cvsurl
  171. &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
  172. ENDIF:cvsurl
  173. </td>
  174. </tr>
  175. <tr>
  176. <td class="small-title-font">Modified:</td>
  177. <td class="small-title-font">%dtm_modified%</td>
  178. </tr>
  179. </table>
  180. </td></tr></table></td>
  181. </tr>
  182. </table><br />
  183. _FILE_PAGE_
  184. ###################################################################
  185. CLASS_PAGE = %{
  186. <table width="100%" border="0" cellspacing="0">
  187. <tr class="title-row">
  188. <td class="big-title-font">
  189. <font size="-3"><b>%classmod%</b><br /></font>%full_name%
  190. </td>
  191. <td align="right">
  192. <table cellspacing="0" cellpadding="2">
  193. <tr valign="top">
  194. <td class="small-title-font">In:</td>
  195. <td class="small-title-font">
  196. START:infiles
  197. HREF:full_path_url:full_path:
  198. IF:cvsurl
  199. &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
  200. ENDIF:cvsurl
  201. END:infiles
  202. </td>
  203. </tr>
  204. IF:parent
  205. <tr>
  206. <td class="small-title-font">Parent:</td>
  207. <td class="small-title-font">
  208. IF:par_url
  209. <a href="%par_url%" class="cyan">
  210. ENDIF:par_url
  211. %parent%
  212. IF:par_url
  213. </a>
  214. ENDIF:par_url
  215. </td>
  216. </tr>
  217. ENDIF:parent
  218. </table>
  219. </td>
  220. </tr>
  221. </table><br />
  222. }
  223. ###################################################################
  224. METHOD_LIST = %{
  225. IF:includes
  226. <div class="tablesubsubtitle">Uses</div><br />
  227. <div class="name-list">
  228. START:includes
  229. <span class="method-name">HREF:aref:name:</span>
  230. END:includes
  231. </div>
  232. ENDIF:includes
  233. IF:method_list
  234. START:method_list
  235. IF:methods
  236. <table cellpadding="5" width="100%">
  237. <tr><td class="tablesubtitle">%type% %category% methods</td></tr>
  238. </table>
  239. START:methods
  240. <table width="100%" cellspacing="0" cellpadding="5" border="0">
  241. <tr><td class="methodtitle">
  242. <a name="%aref%">
  243. <b>%name%</b>%params%
  244. IF:codeurl
  245. <a href="%codeurl%" target="source" class="srclink">src</a>
  246. ENDIF:codeurl
  247. </a></td></tr>
  248. </table>
  249. IF:m_desc
  250. <div class="description">
  251. %m_desc%
  252. </div>
  253. ENDIF:m_desc
  254. END:methods
  255. ENDIF:methods
  256. END:method_list
  257. ENDIF:method_list
  258. }
  259. =begin
  260. =end
  261. ########################## Source code ##########################
  262. SRC_PAGE = %{
  263. <html>
  264. <head><title>%title%</title>
  265. <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
  266. <style type="text/css">
  267. .kw { color: #3333FF; font-weight: bold }
  268. .cmt { color: green; font-style: italic }
  269. .str { color: #662222; font-style: italic }
  270. .re { color: #662222; }
  271. .ruby-comment { color: green; font-style: italic }
  272. .ruby-constant { color: #4433aa; font-weight: bold; }
  273. .ruby-identifier { color: #222222; }
  274. .ruby-ivar { color: #2233dd; }
  275. .ruby-keyword { color: #3333FF; font-weight: bold }
  276. .ruby-node { color: #777777; }
  277. .ruby-operator { color: #111111; }
  278. .ruby-regexp { color: #662222; }
  279. .ruby-value { color: #662222; font-style: italic }
  280. </style>
  281. </head>
  282. <body bgcolor="#BBBBBB">
  283. <pre>%code%</pre>
  284. </body>
  285. </html>
  286. }
  287. ########################## Index ################################
  288. FR_INDEX_BODY = %{
  289. !INCLUDE!
  290. }
  291. FILE_INDEX = %{
  292. <html>
  293. <head>
  294. <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
  295. <style type="text/css">
  296. <!--
  297. body {
  298. background-color: #bbbbbb;
  299. font-family: #{FONTS};
  300. font-size: 11px;
  301. font-style: normal;
  302. line-height: 14px;
  303. color: #000040;
  304. }
  305. div.banner {
  306. background: #bbbbcc;
  307. color: white;
  308. padding: 1;
  309. margin: 0;
  310. font-size: 90%;
  311. font-weight: bold;
  312. line-height: 1.1;
  313. text-align: center;
  314. width: 100%;
  315. }
  316. -->
  317. </style>
  318. <base target="docwin">
  319. </head>
  320. <body>
  321. <div class="banner">%list_title%</div>
  322. START:entries
  323. <a href="%href%">%name%</a><br />
  324. END:entries
  325. </body></html>
  326. }
  327. CLASS_INDEX = FILE_INDEX
  328. METHOD_INDEX = FILE_INDEX
  329. INDEX = %{
  330. <html>
  331. <head>
  332. <title>%title%</title>
  333. <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
  334. </head>
  335. <frameset cols="20%,*">
  336. <frameset rows="15%,35%,50%">
  337. <frame src="fr_file_index.html" title="Files" name="Files">
  338. <frame src="fr_class_index.html" name="Modules">
  339. <frame src="fr_method_index.html" name="Subroutines and Functions">
  340. </frameset>
  341. <frameset rows="80%,20%">
  342. <frame src="%initial_page%" name="docwin">
  343. <frame src="blank.html" name="source">
  344. </frameset>
  345. <noframes>
  346. <body bgcolor="#BBBBBB">
  347. Click <a href="html/index.html">here</a> for a non-frames
  348. version of this page.
  349. </body>
  350. </noframes>
  351. </frameset>
  352. </html>
  353. }
  354. # and a blank page to use as a target
  355. BLANK = %{
  356. <html><body bgcolor="#BBBBBB"></body></html>
  357. }
  358. def write_extra_pages
  359. template = TemplatePage.new(BLANK)
  360. File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
  361. end
  362. end
  363. end