webgen 1.0.0.beta2 → 1.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/COPYING +34 -1
  2. data/Rakefile +1 -8
  3. data/data/webgen/passive_sources/default.metainfo +5 -0
  4. data/data/webgen/passive_sources/stylesheets/api.css +284 -0
  5. data/data/webgen/passive_sources/templates/api.template +151 -0
  6. data/data/webgen/passive_sources/templates/feed.template +4 -0
  7. data/lib/webgen/bundle/built-in/init.rb +12 -3
  8. data/lib/webgen/bundle_loader.rb +8 -2
  9. data/lib/webgen/cli/create_command.rb +3 -1
  10. data/lib/webgen/cli/show_tree_command.rb +4 -3
  11. data/lib/webgen/content_processor.rb +2 -2
  12. data/lib/webgen/content_processor/blocks.rb +2 -2
  13. data/lib/webgen/content_processor/haml.rb +1 -1
  14. data/lib/webgen/content_processor/html_head.rb +5 -4
  15. data/lib/webgen/content_processor/kramdown.rb +3 -1
  16. data/lib/webgen/content_processor/r_doc.rb +16 -3
  17. data/lib/webgen/content_processor/sass.rb +3 -3
  18. data/lib/webgen/content_processor/scss.rb +1 -1
  19. data/lib/webgen/content_processor/tikz.rb +2 -2
  20. data/lib/webgen/context/html_head.rb +1 -1
  21. data/lib/webgen/destination/file_system.rb +2 -1
  22. data/lib/webgen/item_tracker/node_content.rb +4 -4
  23. data/lib/webgen/item_tracker/node_meta_info.rb +6 -6
  24. data/lib/webgen/item_tracker/nodes.rb +1 -1
  25. data/lib/webgen/node.rb +5 -7
  26. data/lib/webgen/node_finder.rb +40 -17
  27. data/lib/webgen/page.rb +10 -0
  28. data/lib/webgen/path.rb +14 -14
  29. data/lib/webgen/path_handler.rb +19 -13
  30. data/lib/webgen/path_handler/api.rb +173 -0
  31. data/lib/webgen/path_handler/base.rb +33 -11
  32. data/lib/webgen/path_handler/copy.rb +2 -27
  33. data/lib/webgen/path_handler/feed.rb +4 -3
  34. data/lib/webgen/path_handler/meta_info.rb +1 -1
  35. data/lib/webgen/path_handler/page_utils.rb +4 -3
  36. data/lib/webgen/path_handler/sitemap.rb +3 -2
  37. data/lib/webgen/path_handler/virtual.rb +7 -2
  38. data/lib/webgen/tag.rb +5 -5
  39. data/lib/webgen/tag/execute_command.rb +1 -1
  40. data/lib/webgen/tag/include_file.rb +1 -1
  41. data/lib/webgen/tag/link.rb +2 -2
  42. data/lib/webgen/tag/menu.rb +1 -1
  43. data/lib/webgen/tag/meta_info.rb +1 -0
  44. data/lib/webgen/tag/relocatable.rb +1 -1
  45. data/lib/webgen/tag/tikz.rb +2 -2
  46. data/lib/webgen/task/create_website.rb +1 -1
  47. data/lib/webgen/test_helper.rb +20 -16
  48. data/lib/webgen/tree.rb +5 -1
  49. data/lib/webgen/version.rb +1 -1
  50. data/lib/webgen/website.rb +8 -8
  51. data/test/webgen/content_processor/test_kramdown.rb +7 -5
  52. data/test/webgen/content_processor/test_sass.rb +4 -0
  53. data/test/webgen/content_processor/test_scss.rb +4 -0
  54. data/test/webgen/content_processor/test_tikz.rb +6 -2
  55. data/test/webgen/destination/test_file_system.rb +3 -4
  56. data/test/webgen/item_tracker/test_missing_node.rb +3 -3
  57. data/test/webgen/item_tracker/test_node_content.rb +9 -12
  58. data/test/webgen/item_tracker/test_node_meta_info.rb +7 -11
  59. data/test/webgen/item_tracker/test_nodes.rb +11 -5
  60. data/test/webgen/path_handler/test_api.rb +111 -0
  61. data/test/webgen/path_handler/test_page_utils.rb +1 -1
  62. data/test/webgen/source/test_file_system.rb +3 -3
  63. data/test/webgen/tag/test_coderay.rb +3 -4
  64. data/test/webgen/tag/test_meta_info.rb +3 -0
  65. data/test/webgen/task/test_create_website.rb +2 -2
  66. data/test/webgen/test_item_tracker.rb +11 -16
  67. data/test/webgen/test_node.rb +2 -0
  68. data/test/webgen/test_node_finder.rb +30 -2
  69. data/test/webgen/test_page.rb +8 -0
  70. data/test/webgen/test_source.rb +11 -18
  71. data/test/webgen/test_tag.rb +1 -1
  72. data/test/webgen/test_tree.rb +8 -8
  73. metadata +8 -88
  74. data/ChangeLog +0 -23710
  75. data/data/webgen/website_bundles/default/README +0 -6
  76. data/data/webgen/website_bundles/default/src/index.page +0 -15
  77. data/data/webgen/website_bundles/style/1024px/README +0 -13
  78. data/data/webgen/website_bundles/style/1024px/src/default.css +0 -188
  79. data/data/webgen/website_bundles/style/1024px/src/default.template +0 -60
  80. data/data/webgen/website_bundles/style/1024px/src/images/background.gif +0 -0
  81. data/data/webgen/website_bundles/style/andreas00/README +0 -13
  82. data/data/webgen/website_bundles/style/andreas00/src/default.css +0 -290
  83. data/data/webgen/website_bundles/style/andreas00/src/default.template +0 -60
  84. data/data/webgen/website_bundles/style/andreas00/src/images/bg.gif +0 -0
  85. data/data/webgen/website_bundles/style/andreas00/src/images/front.jpg +0 -0
  86. data/data/webgen/website_bundles/style/andreas00/src/images/menubg.gif +0 -0
  87. data/data/webgen/website_bundles/style/andreas00/src/images/menubg2.gif +0 -0
  88. data/data/webgen/website_bundles/style/andreas01/README +0 -14
  89. data/data/webgen/website_bundles/style/andreas01/src/default.css +0 -310
  90. data/data/webgen/website_bundles/style/andreas01/src/default.template +0 -62
  91. data/data/webgen/website_bundles/style/andreas01/src/images/bg.gif +0 -0
  92. data/data/webgen/website_bundles/style/andreas01/src/images/front.jpg +0 -0
  93. data/data/webgen/website_bundles/style/andreas01/src/print.css +0 -35
  94. data/data/webgen/website_bundles/style/andreas03/README +0 -14
  95. data/data/webgen/website_bundles/style/andreas03/src/default.css +0 -223
  96. data/data/webgen/website_bundles/style/andreas03/src/default.template +0 -58
  97. data/data/webgen/website_bundles/style/andreas03/src/images/bodybg.png +0 -0
  98. data/data/webgen/website_bundles/style/andreas03/src/images/contbg.png +0 -0
  99. data/data/webgen/website_bundles/style/andreas03/src/images/footerbg.png +0 -0
  100. data/data/webgen/website_bundles/style/andreas03/src/images/gradient1.png +0 -0
  101. data/data/webgen/website_bundles/style/andreas03/src/images/gradient2.png +0 -0
  102. data/data/webgen/website_bundles/style/andreas04/README +0 -15
  103. data/data/webgen/website_bundles/style/andreas04/src/default.css +0 -290
  104. data/data/webgen/website_bundles/style/andreas04/src/default.template +0 -81
  105. data/data/webgen/website_bundles/style/andreas04/src/images/blinkarrow.gif +0 -0
  106. data/data/webgen/website_bundles/style/andreas04/src/images/bodybg.png +0 -0
  107. data/data/webgen/website_bundles/style/andreas04/src/images/contentbg.png +0 -0
  108. data/data/webgen/website_bundles/style/andreas04/src/images/entrybg.png +0 -0
  109. data/data/webgen/website_bundles/style/andreas04/src/images/flash.gif +0 -0
  110. data/data/webgen/website_bundles/style/andreas04/src/images/flash2.gif +0 -0
  111. data/data/webgen/website_bundles/style/andreas04/src/images/globe.gif +0 -0
  112. data/data/webgen/website_bundles/style/andreas04/src/images/globebottom.gif +0 -0
  113. data/data/webgen/website_bundles/style/andreas04/src/images/linkarrow.gif +0 -0
  114. data/data/webgen/website_bundles/style/andreas04/src/images/menuhover.png +0 -0
  115. data/data/webgen/website_bundles/style/andreas05/README +0 -14
  116. data/data/webgen/website_bundles/style/andreas05/src/default.css +0 -33
  117. data/data/webgen/website_bundles/style/andreas05/src/default.template +0 -40
  118. data/data/webgen/website_bundles/style/andreas05/src/images/bodybg.gif +0 -0
  119. data/data/webgen/website_bundles/style/andreas05/src/images/front.png +0 -0
  120. data/data/webgen/website_bundles/style/andreas06/README +0 -14
  121. data/data/webgen/website_bundles/style/andreas06/src/default.css +0 -356
  122. data/data/webgen/website_bundles/style/andreas06/src/default.template +0 -70
  123. data/data/webgen/website_bundles/style/andreas06/src/images/bodybg.gif +0 -0
  124. data/data/webgen/website_bundles/style/andreas06/src/images/boxbg.gif +0 -0
  125. data/data/webgen/website_bundles/style/andreas06/src/images/greypx.gif +0 -0
  126. data/data/webgen/website_bundles/style/andreas06/src/images/header.jpg +0 -0
  127. data/data/webgen/website_bundles/style/andreas06/src/images/innerbg.gif +0 -0
  128. data/data/webgen/website_bundles/style/andreas06/src/images/leaves.jpg +0 -0
  129. data/data/webgen/website_bundles/style/andreas06/src/images/tabs.gif +0 -0
  130. data/data/webgen/website_bundles/style/andreas07/README +0 -15
  131. data/data/webgen/website_bundles/style/andreas07/src/browserfix.css +0 -7
  132. data/data/webgen/website_bundles/style/andreas07/src/default.css +0 -92
  133. data/data/webgen/website_bundles/style/andreas07/src/default.template +0 -42
  134. data/data/webgen/website_bundles/style/andreas07/src/images/bodybg.gif +0 -0
  135. data/data/webgen/website_bundles/style/andreas07/src/images/sidebarbg.gif +0 -0
  136. data/data/webgen/website_bundles/style/andreas08/README +0 -14
  137. data/data/webgen/website_bundles/style/andreas08/src/default.css +0 -224
  138. data/data/webgen/website_bundles/style/andreas08/src/default.template +0 -51
  139. data/data/webgen/website_bundles/style/andreas09/README +0 -14
  140. data/data/webgen/website_bundles/style/andreas09/src/default.css +0 -308
  141. data/data/webgen/website_bundles/style/andreas09/src/default.template +0 -68
  142. data/data/webgen/website_bundles/style/andreas09/src/images/bodybg-black.jpg +0 -0
  143. data/data/webgen/website_bundles/style/andreas09/src/images/bodybg-green.jpg +0 -0
  144. data/data/webgen/website_bundles/style/andreas09/src/images/bodybg-orange.jpg +0 -0
  145. data/data/webgen/website_bundles/style/andreas09/src/images/bodybg-purple.jpg +0 -0
  146. data/data/webgen/website_bundles/style/andreas09/src/images/bodybg-red.jpg +0 -0
  147. data/data/webgen/website_bundles/style/andreas09/src/images/bodybg.jpg +0 -0
  148. data/data/webgen/website_bundles/style/andreas09/src/images/footerbg.jpg +0 -0
  149. data/data/webgen/website_bundles/style/andreas09/src/images/menuhover-black.jpg +0 -0
  150. data/data/webgen/website_bundles/style/andreas09/src/images/menuhover-green.jpg +0 -0
  151. data/data/webgen/website_bundles/style/andreas09/src/images/menuhover-orange.jpg +0 -0
  152. data/data/webgen/website_bundles/style/andreas09/src/images/menuhover-purple.jpg +0 -0
  153. data/data/webgen/website_bundles/style/andreas09/src/images/menuhover-red.jpg +0 -0
  154. data/data/webgen/website_bundles/style/andreas09/src/images/menuhover.jpg +0 -0
  155. data/data/webgen/website_bundles/style/simple/README +0 -6
  156. data/data/webgen/website_bundles/style/simple/src/default.css +0 -84
  157. data/data/webgen/website_bundles/style/simple/src/default.template +0 -36
data/COPYING CHANGED
@@ -1,5 +1,5 @@
1
1
  webgen - static website generation made easy
2
- Copyright (C) 2003-2012 Thomas Leitner <t_leitner@gmx.at>
2
+ Copyright (C) 2003-2013 Thomas Leitner <t_leitner@gmx.at>
3
3
 
4
4
  webgen is free software: you can redistribute it and/or modify
5
5
  it under the terms of the GNU General Public License as published by
@@ -21,3 +21,36 @@ license. These files/directories are listed here:
21
21
  data/webgen/passive_sources/stylesheets/coderay-default.css:
22
22
  This file has been generated with the coderay_stylesheet binary and
23
23
  falls under the LGPL.
24
+
25
+ data/webgen/passive_sources/stylesheets/api.css
26
+ data/webgen/passive_sources/templates/api.template
27
+ These files are based on the rdoc darkfish template by Michael Granger
28
+ and adapted for use with webgen. They are licensed under the following
29
+ license:
30
+
31
+ Copyright (c) 2007, 2008, Michael Granger. All rights reserved.
32
+
33
+ Redistribution and use in source and binary forms, with or without
34
+ modification, are permitted provided that the following conditions are met:
35
+
36
+ * Redistributions of source code must retain the above copyright notice,
37
+ this list of conditions and the following disclaimer.
38
+
39
+ * Redistributions in binary form must reproduce the above copyright notice,
40
+ this list of conditions and the following disclaimer in the documentation
41
+ and/or other materials provided with the distribution.
42
+
43
+ * Neither the name of the author/s, nor the names of the project's
44
+ contributors may be used to endorse or promote products derived from this
45
+ software without specific prior written permission.
46
+
47
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
48
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
50
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
51
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
53
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
54
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
55
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
56
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/Rakefile CHANGED
@@ -93,7 +93,6 @@ EOF
93
93
  'Rakefile',
94
94
  'setup.rb',
95
95
  'VERSION',
96
- 'ChangeLog',
97
96
  'AUTHORS',
98
97
  'THANKS',
99
98
  'COPYING',
@@ -115,12 +114,6 @@ EOF
115
114
  File.open('VERSION', 'w+') {|file| file.write(Webgen::VERSION + "\n")}
116
115
  end
117
116
 
118
- CLOBBER << 'ChangeLog'
119
- file 'ChangeLog' do
120
- puts "Generating ChangeLog file"
121
- `git log --name-only > ChangeLog`
122
- end
123
-
124
117
  Rake::PackageTask.new('webgen', Webgen::VERSION) do |pkg|
125
118
  pkg.need_tar = true
126
119
  pkg.need_zip = true
@@ -162,7 +155,7 @@ EOF
162
155
  s.add_development_dependency('haml', '>= 3.1.0')
163
156
  s.add_development_dependency('sass', '>= 3.2.0')
164
157
  s.add_development_dependency('builder', '>= 2.1.0')
165
- s.add_development_dependency('rdoc', '>= 3.0')
158
+ s.add_development_dependency('rdoc', '>= 4.0')
166
159
  s.add_development_dependency('coderay', '>= 1.0.0')
167
160
  s.add_development_dependency('erubis', '>= 2.6.5')
168
161
  s.add_development_dependency('rdiscount', '>= 1.3.5')
@@ -25,6 +25,11 @@
25
25
  [/**/virtual, /**/*.virtual]:
26
26
  handler: virtual
27
27
 
28
+ /**/*.api:
29
+ handler: api
30
+ api_template: /templates/api.template
31
+ prefix_for_link_defs: true
32
+
28
33
  [/**/*.css, /**/*.js, /**/*.html, /**/*.gif, /**/*.jpg, /**/*.png, /**/*.ico]:
29
34
  handler: copy
30
35
 
@@ -0,0 +1,284 @@
1
+ /*
2
+ * "Darkfish" Rdoc CSS
3
+ * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $
4
+ *
5
+ * Author: Michael Granger <ged@FaerieMUD.org>
6
+ *
7
+ * Adapted for webgen by Thomas Leitner <t_leitner@gmx.at>
8
+ *
9
+ */
10
+
11
+ .api-documentation h1 span,
12
+ .api-documentation h2 span,
13
+ .api-documentation h3 span,
14
+ .api-documentation h4 span,
15
+ .api-documentation h5 span,
16
+ .api-documentation h6 span {
17
+ display: none;
18
+ }
19
+
20
+ .api-documentation pre {
21
+ background: #ddd;
22
+ padding: 0.5em 0;
23
+ }
24
+
25
+ .api-documentation blockquote {
26
+ background: #ddd;
27
+ margin: 1em;
28
+ padding: 0.25em;
29
+ }
30
+
31
+ .api-documentation blockquote > :first-child {
32
+ margin-top: 0 !important;
33
+ }
34
+
35
+ .api-documentation .missing-docs {
36
+ font-size: 120%;
37
+ background: white;
38
+ color: #ccc;
39
+ line-height: 2em;
40
+ border: 1px solid #d00;
41
+ opacity: 1;
42
+ padding-left: 20px;
43
+ text-indent: 24px;
44
+ letter-spacing: 3px;
45
+ font-weight: bold;
46
+ -webkit-border-radius: 5px;
47
+ -moz-border-radius: 5px;
48
+ }
49
+
50
+ .api-documentation .target-section {
51
+ border: 2px solid #dcce90;
52
+ border-left-width: 8px;
53
+ padding: 0 1em;
54
+ background: #fff3c2;
55
+ }
56
+
57
+ /* @group Documentation Section */
58
+ .api-documentation .description {
59
+ font-size: 100%;
60
+ color: #333;
61
+ }
62
+
63
+ .api-documentation .description p {
64
+ margin: 1em 0.4em;
65
+ }
66
+
67
+ .api-documentation .description li p {
68
+ margin: 0;
69
+ }
70
+
71
+ .api-documentation .description ol,
72
+ .api-documentation .description ul {
73
+ margin-left: 1.5em;
74
+ }
75
+ .api-documentation .description ol li,
76
+ .api-documentation .description ul li {
77
+ line-height: 1.4em;
78
+ }
79
+
80
+ .api-documentation .note-list {
81
+ margin: 8px 0;
82
+ }
83
+
84
+ .api-documentation .label-list {
85
+ margin: 8px 1.5em;
86
+ border: 1px solid #ccc;
87
+ }
88
+ .api-documentation .description .label-list {
89
+ font-size: 14px;
90
+ }
91
+
92
+ .api-documentation .note-list dt {
93
+ font-weight: bold;
94
+ }
95
+ .api-documentation .note-list dd {
96
+ padding: 0 12px;
97
+ }
98
+
99
+ .api-documentation .label-list dt {
100
+ padding: 2px 4px;
101
+ font-weight: bold;
102
+ background: #ddd;
103
+ }
104
+ .api-documentation .label-list dd {
105
+ padding: 2px 12px;
106
+ }
107
+ .api-documentation .label-list dd + dt,
108
+ .api-documentation .note-list dd + dt {
109
+ margin-top: 0.7em;
110
+ }
111
+
112
+ .api-documentation .section {
113
+ font-size: 90%;
114
+ }
115
+
116
+ .api-documentation h2.section-header {
117
+ margin-top: 1em;
118
+ padding: 0.25em 0.5em;
119
+ background: #ccc;
120
+ color: #333;
121
+ font-size: 175%;
122
+ border: 1px solid #bbb;
123
+ -moz-border-radius: 3px;
124
+ -webkit-border-radius: 3px;
125
+ }
126
+
127
+ .documentation-section-title {
128
+ position: relative;
129
+ }
130
+ .documentation-section-title .section-click-top {
131
+ position: absolute;
132
+ top: 6px;
133
+ right: 12px;
134
+ font-size: 10px;
135
+ color: #9b9877;
136
+ visibility: hidden;
137
+ padding-right: 0.5px;
138
+ }
139
+
140
+ .documentation-section-title:hover .section-click-top {
141
+ visibility: visible;
142
+ }
143
+
144
+ .api-documentation h3.section-header {
145
+ margin-top: 1em;
146
+ padding: 0.25em 0.5em;
147
+ background-color: #dedede;
148
+ color: #333;
149
+ font-size: 150%;
150
+ border: 1px solid #bbb;
151
+ -moz-border-radius: 3px;
152
+ -webkit-border-radius: 3px;
153
+ }
154
+
155
+ .documentation-section h2 {
156
+ position: relative;
157
+ }
158
+
159
+ .documentation-section h2 a {
160
+ position: absolute;
161
+ top: 8px;
162
+ right: 10px;
163
+ font-size: 12px;
164
+ color: #9b9877;
165
+ visibility: hidden;
166
+ }
167
+
168
+ .documentation-section h2:hover a {
169
+ visibility: visible;
170
+ }
171
+
172
+ /* @group Method Details */
173
+
174
+ .api-documentation .method-source-code {
175
+ display: none;
176
+ }
177
+
178
+ .api-documentation .method-description .method-calls-super {
179
+ color: #333;
180
+ font-weight: bolder;
181
+ }
182
+
183
+ .api-documentation .method-detail {
184
+ margin: 0.5em 0;
185
+ padding: 0.5em 0;
186
+ cursor: pointer;
187
+ }
188
+ .api-documentation .method-detail:hover {
189
+ background-color: #f1edba;
190
+ }
191
+ .api-documentation .method-heading {
192
+ position: relative;
193
+ padding: 2px 4px 0 20px;
194
+ font-size: 125%;
195
+ font-weight: bold;
196
+ color: #333;
197
+ }
198
+ .api-documentation .method-heading :link,
199
+ .api-documentation .method-heading :visited {
200
+ color: inherit;
201
+ }
202
+ .api-documentation .method-click-advice {
203
+ position: absolute;
204
+ top: 2px;
205
+ right: 5px;
206
+ font-size: 10px;
207
+ color: #9b9877;
208
+ visibility: hidden;
209
+ padding-right: 20px;
210
+ line-height: 20px;
211
+ }
212
+ .api-documentation .method-heading:hover .method-click-advice {
213
+ visibility: visible;
214
+ }
215
+
216
+ .api-documentation .method-alias .method-heading {
217
+ color: #666;
218
+ }
219
+
220
+ .api-documentation .method-description,
221
+ .api-documentation .aliases {
222
+ margin: 0 20px;
223
+ color: #666;
224
+ }
225
+
226
+ .api-documentation .method-description p,
227
+ .api-documentation .aliases p {
228
+ line-height: 1.2em;
229
+ }
230
+
231
+ .api-documentation .aliases {
232
+ padding-top: 4px;
233
+ font-style: italic;
234
+ cursor: default;
235
+ }
236
+ .api-documentation .method-description p {
237
+ margin-bottom: 0.5em;
238
+ }
239
+ .api-documentation .method-description ul {
240
+ margin-left: 1.5em;
241
+ }
242
+ .api-documentation pre {
243
+ margin: 0.5em 0;
244
+ }
245
+
246
+ .api-documentation #attribute-method-details .method-detail:hover {
247
+ background-color: transparent;
248
+ cursor: default;
249
+ }
250
+ .api-documentation .attribute-access-type {
251
+ font-size: 60%;
252
+ text-transform: uppercase;
253
+ vertical-align: super;
254
+ padding: 0 2px;
255
+ }
256
+ /* @end */
257
+
258
+ /* @end */
259
+
260
+ /* @group Source Code */
261
+
262
+ .api-documentation pre {
263
+ overflow: auto;
264
+ background: #262626;
265
+ color: white;
266
+ border: 1px dashed #999;
267
+ padding: 0.5em;
268
+ }
269
+
270
+ .api-documentation .description pre {
271
+ margin: 0 0.4em;
272
+ }
273
+
274
+ .ruby-constant { color: #7fffd4; background: transparent; }
275
+ .ruby-keyword { color: #00ffff; background: transparent; }
276
+ .ruby-ivar { color: #eedd82; background: transparent; }
277
+ .ruby-operator { color: #00ffee; background: transparent; }
278
+ .ruby-identifier { color: #ffdead; background: transparent; }
279
+ .ruby-node { color: #ffa07a; background: transparent; }
280
+ .ruby-comment { color: #dc0000; font-weight: bold; background: transparent; }
281
+ .ruby-regexp { color: #ffa07a; background: transparent; }
282
+ .ruby-value { color: #7fffd4; background: transparent; }
283
+
284
+ /* @end */
@@ -0,0 +1,151 @@
1
+ --- name:content pipeline:erb
2
+ <% klass = context.node.node_info[:api_class_object] %>
3
+ <div class="api-documentation api-<%= klass.type %>">
4
+ <h1 class="<%= klass.type %>"><%= klass.type %> <%= klass.full_name %></h1>
5
+
6
+ <div class="description">
7
+ <%= klass.description %>
8
+ </div><!-- description -->
9
+
10
+ <% klass.each_section do |section, constants, attributes| %>
11
+ <% constants = constants.select { |const| const.display? } %>
12
+ <% attributes = attributes.select { |attr| attr.display? } %>
13
+ <section id="<%= section.aref %>" class="documentation-section">
14
+ <% if section.title then %>
15
+ <div class="documentation-section-title">
16
+ <h2 class="section-header">
17
+ <%= section.title %>
18
+ </h2>
19
+ </div>
20
+ <% end %>
21
+
22
+ <% if section.comment then %>
23
+ <div class="description">
24
+ <%= section.description %>
25
+ </div>
26
+ <% end %>
27
+
28
+ <% unless constants.empty? then %>
29
+ <!-- Constants -->
30
+ <section id="constants-list" class="section">
31
+ <h3 class="section-header">Constants</h3>
32
+ <dl>
33
+ <% constants.each do |const| %>
34
+ <dt id="<%= const.name %>"><%= const.name %>
35
+ <% if const.comment then %>
36
+ <dd class="description"><%= const.description.strip %>
37
+ <% else %>
38
+ <dd class="description missing-docs">(Not documented)
39
+ <% end %>
40
+ <% end %>
41
+ </dl>
42
+ </section>
43
+ <% end %>
44
+
45
+ <% unless attributes.empty? then %>
46
+ <!-- Attributes -->
47
+ <section id="attribute-method-details" class="method-section section">
48
+ <h3 class="section-header">Attributes</h3>
49
+
50
+ <% attributes.each do |attrib| %>
51
+ <div id="<%= attrib.aref %>" class="method-detail">
52
+ <div class="method-heading attribute-method-heading">
53
+ <span class="method-name"><%= h attrib.name %></span><span
54
+ class="attribute-access-type">[<%= attrib.rw %>]</span>
55
+ </div>
56
+
57
+ <div class="method-description">
58
+ <% if attrib.comment then %>
59
+ <%= attrib.description.strip %>
60
+ <% else %>
61
+ <p class="missing-docs">(Not documented)
62
+ <% end %>
63
+ </div>
64
+ </div>
65
+ <% end %>
66
+ </section><!-- attribute-method-details -->
67
+ <% end %>
68
+
69
+ <!-- Methods -->
70
+ <% klass.methods_by_type(section).each do |type, visibilities|
71
+ next if visibilities.empty?
72
+ visibilities.each do |visibility, methods|
73
+ next if methods.empty? %>
74
+ <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section section">
75
+ <h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
76
+
77
+ <% methods.each do |method| %>
78
+ <div id="<%= method.aref %>" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
79
+ <% if method.call_seq then %>
80
+ <% method.call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
81
+ <div class="method-heading">
82
+ <span class="method-callseq">
83
+ <%= h(call_seq.strip.
84
+ gsub( /^\w+\./m, '')).
85
+ gsub(/(.*)[-=]&gt;/, '\1&rarr;') %>
86
+ </span>
87
+ <% if i == 0 and method.token_stream then %>
88
+ <span class="method-click-advice">click to toggle source</span>
89
+ <% end %>
90
+ </div>
91
+ <% end %>
92
+ <% else %>
93
+ <div class="method-heading">
94
+ <span class="method-name"><%= h method.name %></span><span
95
+ class="method-args"><%= method.param_seq %></span>
96
+ <% if method.token_stream then %>
97
+ <span class="method-click-advice">click to toggle source</span>
98
+ <% end %>
99
+ </div>
100
+ <% end %>
101
+
102
+ <div class="method-description">
103
+ <% if method.comment then %>
104
+ <%= method.description.strip %>
105
+ <% else %>
106
+ <p class="missing-docs">(Not documented)
107
+ <% end %>
108
+ <% if method.calls_super then %>
109
+ <div class="method-calls-super">
110
+ Calls superclass method
111
+ <%=
112
+ method.superclass_method ?
113
+ method.formatter.link(method.superclass_method.full_name, method.superclass_method.full_name) : nil
114
+ %>
115
+ </div>
116
+ <% end %>
117
+
118
+ <% if method.token_stream then %>
119
+ <div class="method-source-code" id="<%= method.html_name %>-source">
120
+ <pre><%= method.markup_code %></pre>
121
+ </div><!-- <%= method.html_name %>-source -->
122
+ <% end %>
123
+ </div>
124
+
125
+ <% unless method.aliases.empty? then %>
126
+ <div class="aliases">
127
+ Also aliased as: <%= method.aliases.map do |aka|
128
+ if aka.parent then # HACK lib/rexml/encodings
129
+ %{<a href="#{klass.aref_to aka.path}">#{h aka.name}</a>}
130
+ else
131
+ h aka.name
132
+ end
133
+ end.join ", " %>
134
+ </div>
135
+ <% end %>
136
+
137
+ <% if method.is_alias_for then %>
138
+ <div class="aliases">
139
+ Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
140
+ </div>
141
+ <% end %>
142
+ </div><!-- <%= method.html_name %>-method -->
143
+
144
+ <% end %>
145
+ </section><!-- <%= visibility %>-<%= type %>-method-details -->
146
+ <% end
147
+ end %>
148
+ </section><!-- <%= section.aref %> -->
149
+ <% end %>
150
+
151
+ </div><!-- documentation -->