sdoc 0.2.12.1

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.
Files changed (45) hide show
  1. data/LICENSE +21 -0
  2. data/README.rdoc +38 -0
  3. data/Rakefile +37 -0
  4. data/VERSION.yml +4 -0
  5. data/bin/sdoc +11 -0
  6. data/bin/sdoc-merge +12 -0
  7. data/lib/rdoc/discover.rb +1 -0
  8. data/lib/sdoc.rb +23 -0
  9. data/lib/sdoc/c_parser_fix.rb +31 -0
  10. data/lib/sdoc/generator/shtml.rb +314 -0
  11. data/lib/sdoc/generator/template/direct/_context.rhtml +172 -0
  12. data/lib/sdoc/generator/template/direct/class.rhtml +40 -0
  13. data/lib/sdoc/generator/template/direct/file.rhtml +30 -0
  14. data/lib/sdoc/generator/template/direct/index.rhtml +14 -0
  15. data/lib/sdoc/generator/template/direct/resources/css/main.css +263 -0
  16. data/lib/sdoc/generator/template/direct/resources/css/panel.css +383 -0
  17. data/lib/sdoc/generator/template/direct/resources/css/reset.css +53 -0
  18. data/lib/sdoc/generator/template/direct/resources/i/arrows.png +0 -0
  19. data/lib/sdoc/generator/template/direct/resources/i/results_bg.png +0 -0
  20. data/lib/sdoc/generator/template/direct/resources/i/tree_bg.png +0 -0
  21. data/lib/sdoc/generator/template/direct/resources/js/jquery-1.3.2.min.js +19 -0
  22. data/lib/sdoc/generator/template/direct/resources/js/jquery-effect.js +593 -0
  23. data/lib/sdoc/generator/template/direct/resources/js/main.js +22 -0
  24. data/lib/sdoc/generator/template/direct/resources/js/searchdoc.js +620 -0
  25. data/lib/sdoc/generator/template/direct/resources/panel/index.html +71 -0
  26. data/lib/sdoc/generator/template/merge/index.rhtml +14 -0
  27. data/lib/sdoc/generator/template/shtml/_context.rhtml +164 -0
  28. data/lib/sdoc/generator/template/shtml/class.rhtml +46 -0
  29. data/lib/sdoc/generator/template/shtml/file.rhtml +37 -0
  30. data/lib/sdoc/generator/template/shtml/index.rhtml +14 -0
  31. data/lib/sdoc/generator/template/shtml/resources/css/main.css +191 -0
  32. data/lib/sdoc/generator/template/shtml/resources/css/panel.css +383 -0
  33. data/lib/sdoc/generator/template/shtml/resources/css/reset.css +53 -0
  34. data/lib/sdoc/generator/template/shtml/resources/i/arrows.png +0 -0
  35. data/lib/sdoc/generator/template/shtml/resources/i/results_bg.png +0 -0
  36. data/lib/sdoc/generator/template/shtml/resources/i/tree_bg.png +0 -0
  37. data/lib/sdoc/generator/template/shtml/resources/js/jquery-1.3.2.min.js +19 -0
  38. data/lib/sdoc/generator/template/shtml/resources/js/main.js +34 -0
  39. data/lib/sdoc/generator/template/shtml/resources/js/searchdoc.js +620 -0
  40. data/lib/sdoc/generator/template/shtml/resources/panel/index.html +71 -0
  41. data/lib/sdoc/github.rb +64 -0
  42. data/lib/sdoc/helpers.rb +26 -0
  43. data/lib/sdoc/merge.rb +217 -0
  44. data/lib/sdoc/templatable.rb +58 -0
  45. metadata +117 -0
@@ -0,0 +1,172 @@
1
+ <div id="content">
2
+ <% unless (desc = context.description).empty? %>
3
+ <div class="description">
4
+ <%= desc %>
5
+ </div>
6
+ <% end %>
7
+
8
+ <% unless context.requires.empty? %>
9
+ <div class="sectiontitle">Required Files</div>
10
+ <ul>
11
+ <% context.requires.each do |req| %>
12
+ <li><%= h req.name %></li>
13
+ <% end %>
14
+ </ul>
15
+ <% end %>
16
+
17
+ <% sections = context.sections.select { |section| section.title } %>
18
+ <% unless sections.empty? %>
19
+ <div class="sectiontitle">Contents</div>
20
+ <ul>
21
+ <% sections.each do |section| %>
22
+ <li><a href="#<%= section.sequence %>"><%= h section.title %></a></li>
23
+ <% end %>
24
+ </ul>
25
+ <% end %>
26
+
27
+ <%
28
+ list = context.method_list
29
+ unless @options.show_all
30
+ list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
31
+ end
32
+ %>
33
+ <% unless list.empty? %>
34
+ <div class="sectiontitle">Methods</div>
35
+ <dl class="methods">
36
+ <% each_letter_group(list) do |group| %>
37
+ <dt><%= group[:name] %></dt>
38
+ <dd>
39
+ <ul>
40
+ <% group[:methods].each_with_index do |method, i| %>
41
+ <li><a href="#<%= method.aref %>"><%= method.name %></a><%= ',' unless group[:methods].size == i+1 %></li>
42
+ <% end %>
43
+ </ul>
44
+ </dd>
45
+ <% end %>
46
+ </dl>
47
+ <% end %>
48
+
49
+ <% unless context.includes.empty? %>
50
+ <div class="sectiontitle">Included Modules</div>
51
+ <ul>
52
+ <% context.includes.each do |inc| %>
53
+ <li>
54
+ <% unless String === inc.module %>
55
+ <a href="<%= context.aref_to inc.module.path %>"><%= h inc.module.full_name %></a>
56
+ <% else %>
57
+ <span><%= h inc.name %></span>
58
+ <% end %>
59
+ START:includes
60
+ </li>
61
+ <% end %>
62
+ </ul>
63
+ <% end %>
64
+
65
+ <% sections.each do |section| %>
66
+ <div class="sectiontitle"><a name="<%= h section.sequence %>"><%= h section.title %></a></div>
67
+ <% unless (description = section.description).empty? %>
68
+ <div class="description">
69
+ <%= description %>
70
+ </div>
71
+ <% end %>
72
+ <% end %>
73
+
74
+ <% unless context.classes_and_modules.empty? %>
75
+ <div class="sectiontitle">Classes and Modules</div>
76
+ <ul>
77
+ <% (context.modules.sort + context.classes.sort).each do |mod| %>
78
+ <li><span class="type"><%= mod.type.upcase %></span> <a href="<%= context.aref_to mod.path %>"><%= mod.full_name %></a></li>
79
+ <% end %>
80
+ </ul>
81
+ <% end %>
82
+
83
+ <% unless context.constants.empty? %>
84
+ <div class="sectiontitle">Constants</div>
85
+ <table border='0' cellpadding='5'>
86
+ <% context.each_constant do |const| %>
87
+ <tr valign='top'>
88
+ <td class="attr-name"><%= h const.name %></td>
89
+ <td>=</td>
90
+ <td class="attr-value"><%= h const.value %></td>
91
+ </tr>
92
+ <% unless (description = const.description).empty? %>
93
+ <tr valign='top'>
94
+ <td>&nbsp;</td>
95
+ <td colspan="2" class="attr-desc"><%= description %></td>
96
+ </tr>
97
+ <% end %>
98
+ <% end %>
99
+ </table>
100
+ <% end %>
101
+
102
+ <% unless context.attributes.empty? %>
103
+ <div class="sectiontitle">Attributes</div>
104
+ <table border='0' cellpadding='5'>
105
+ <% context.each_attribute do |attrib| %>
106
+ <tr valign='top'>
107
+ <td class='attr-rw'>
108
+ [<%= attrib.rw %>]
109
+ </td>
110
+ <td class='attr-name'><%= h attrib.name %></td>
111
+ <td class='attr-desc'><%= attrib.description.strip %></td>
112
+ </tr>
113
+ <% end %>
114
+ </table>
115
+ <% end %>
116
+
117
+ <% context.methods_by_type.each do |type, visibilities|
118
+ next if visibilities.empty?
119
+ visibilities.each do |visibility, methods|
120
+ next if methods.empty?
121
+ next unless @options.show_all || visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
122
+ %>
123
+ <div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
124
+ <% methods.each do |method| %>
125
+ <div class="method">
126
+ <div class="title" id="<%= method.aref %>">
127
+ <% if method.call_seq %>
128
+ <a name="<%= method.aref %>"></a><b><%= method.call_seq.gsub(/->/, '&rarr;') %></b>
129
+ <% else %>
130
+ <a name="<%= method.aref %>"></a><b><%= h method.name %></b><%= h method.params %>
131
+ <% end %>
132
+ </div>
133
+ <% unless (description = method.description).empty? %>
134
+ <div class="description">
135
+ <%= description %>
136
+ </div>
137
+ <% end %>
138
+ <% unless method.aliases.empty? %>
139
+ <div class="aka">
140
+ This method is also aliased as
141
+ <% method.aliases.each do |aka| %>
142
+ <a href="<%= context.aref_to aka.path %>"><%= h aka.name %></a>
143
+ <% end %>
144
+ </div>
145
+ <% end %>
146
+ <% if method.token_stream %>
147
+ <% markup = method.markup_code %>
148
+ <div class="sourcecode">
149
+ <p class="source-link">
150
+ Source: <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
151
+ <%
152
+ if markup =~ /File\s(\S+), line (\d+)/
153
+ path = $1
154
+ line = $2.to_i
155
+ end
156
+ github = github_url(path)
157
+ if github
158
+ %>
159
+ | <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
160
+ <% end %>
161
+ </p>
162
+ <div id="<%= method.aref %>_source" class="dyn-source">
163
+ <pre><%= method.markup_code %></pre>
164
+ </div>
165
+ </div>
166
+ <% end %>
167
+ </div>
168
+ <% end
169
+ end
170
+ end
171
+ %>
172
+ </div>
@@ -0,0 +1,40 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title><%= h klass.full_name %></title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= @options.charset %>" />
8
+ <link rel="stylesheet" href="<%= "#{rel_prefix}/css/reset.css" %>" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="<%= "#{rel_prefix}/css/main.css" %>" type="text/css" media="screen" />
10
+ <script src="<%= "#{rel_prefix}/js/jquery-1.3.2.min.js" %>" type="text/javascript" charset="utf-8"></script>
11
+ <script src="<%= "#{rel_prefix}/js/jquery-effect.js" %>" type="text/javascript" charset="utf-8"></script>
12
+ <script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8"></script>
13
+ </head>
14
+
15
+ <body>
16
+ <div class="banner">
17
+ <h1>
18
+ <span class="type"><%= klass.module? ? 'Module' : 'Class' %></span>
19
+ <%= h klass.full_name %>
20
+ <% if klass.type == 'class' %>
21
+ <span class="parent">&lt;
22
+ <% if String === klass.superclass %>
23
+ <%= klass.superclass %>
24
+ <% elsif !klass.superclass.nil? %>
25
+ <a href="<%= klass.aref_to klass.superclass.path %>"><%= h klass.superclass.full_name %></a>
26
+ <% end %>
27
+ </span>
28
+ <% end %>
29
+ </h1>
30
+ <ul class="files">
31
+ <% klass.in_files.each do |file| %>
32
+ <li><a href="<%= "#{rel_prefix}/#{h file.path}" %>"><%= h file.absolute_name %></a></li>
33
+ <% end %>
34
+ </ul>
35
+ </div>
36
+ <div id="bodyContent">
37
+ <%= include_template '_context.rhtml', {:context => klass, :rel_prefix => rel_prefix} %>
38
+ </div>
39
+ </body>
40
+ </html>
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title><%= h file.name %></title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= @options.charset %>" />
8
+ <link rel="stylesheet" href="<%= "#{rel_prefix}/css/reset.css" %>" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="<%= "#{rel_prefix}/css/main.css" %>" type="text/css" media="screen" />
10
+ <script src="<%= "#{rel_prefix}/js/jquery-1.3.2.min.js" %>" type="text/javascript" charset="utf-8"></script>
11
+ <script src="<%= "#{rel_prefix}/js/jquery-effect.js" %>" type="text/javascript" charset="utf-8"></script>
12
+ <script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8"></script>
13
+ </head>
14
+
15
+ <body>
16
+ <div class="banner">
17
+ <h1>
18
+ <%= h file.name %>
19
+ </h1>
20
+ <ul class="files">
21
+ <li><%= h file.relative_name %></li>
22
+ <li>Last modified: <%= file.file_stat.mtime %></li>
23
+ </ul>
24
+ </div>
25
+
26
+ <div id="bodyContent">
27
+ <%= include_template '_context.rhtml', {:context => file, :rel_prefix => rel_prefix} %>
28
+ </div>
29
+ </body>
30
+ </html>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html
2
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= @options.charset %>" />
7
+
8
+ <title><%= @options.title %></title>
9
+ </head>
10
+ <frameset cols="300,*" frameborder="1" border="1" bordercolor="#666666" framespacing="1">
11
+ <frame src="panel/index.html" title="Search" name="panel" />
12
+ <frame src="<%= index_path %>" name="docwin" />
13
+ </frameset>
14
+ </html>
@@ -0,0 +1,263 @@
1
+ body {
2
+ font-family: "Helvetica Neue", Arial, sans-serif;
3
+ background: #FFF;
4
+ color: #000;
5
+ margin: 0px;
6
+ font-size: 0.82em;
7
+ line-height: 1.25em;
8
+ }
9
+
10
+ a {
11
+ color: #00F;
12
+ text-decoration: none;
13
+ }
14
+
15
+ a:hover {
16
+ color: #333;
17
+ background: #FE8;
18
+ }
19
+
20
+ p {
21
+ margin-bottom: 1em;
22
+ }
23
+
24
+ h1 {
25
+ font-size: 2.1em;
26
+ font-weight: normal;
27
+ line-height: 1.2em;
28
+ margin: 1.4em 0 0.7em 0;
29
+ }
30
+
31
+ h2 {
32
+ font-size: 1.6em;
33
+ margin: 1.8em 0 0.8em 0;
34
+ font-weight: normal;
35
+ line-height: 1.2em;
36
+ }
37
+
38
+ h3 {
39
+ font-size: 1.4em;
40
+ color:#555;
41
+ margin: 1.4em 0 0.7em 0;
42
+ font-weight: normal;
43
+ }
44
+
45
+ h4 {
46
+ margin: 1.4em 0 0.5em 0;
47
+ font-size: 1em;
48
+ }
49
+
50
+ .clear
51
+ {
52
+ clear: both;
53
+ width: 0; height: 0;
54
+ }
55
+
56
+ dt
57
+ {
58
+ margin-bottom: 0.3em;
59
+ font-weight: bold;
60
+ }
61
+
62
+ dd
63
+ {
64
+ margin-left: 2em;
65
+ margin-bottom: 1em;
66
+ }
67
+
68
+ dd p
69
+ {
70
+ margin-top: 0.6em;
71
+ }
72
+
73
+ li
74
+ {
75
+ margin: 0 0 0.5em 2em;
76
+ }
77
+
78
+ ul li
79
+ {
80
+ list-style: disc;
81
+ }
82
+
83
+ ol li
84
+ {
85
+ list-style: decimal;
86
+ }
87
+
88
+ .banner
89
+ {
90
+ background: #EDF3FE;
91
+ border-bottom: 1px solid #ccc;
92
+ padding: 1em 2em 0.5em 2em;
93
+ }
94
+ .banner h1
95
+ {
96
+ font-size: 1.2em;
97
+ margin: 0;
98
+ }
99
+
100
+ .banner h1 .type
101
+ {
102
+ font-size: 0.833em;
103
+ display:block;
104
+ }
105
+
106
+ .banner h1 .type,
107
+ .banner h1 .parent
108
+ {
109
+ color: #666;
110
+ }
111
+
112
+ .banner ul
113
+ {
114
+ margin-top: 0.3em;
115
+ margin-bottom: 0;
116
+ font-size: 0.85em;
117
+ }
118
+
119
+ .banner li
120
+ {
121
+ list-style: none;
122
+ margin-left: 0;
123
+ margin-bottom: 0;
124
+ }
125
+
126
+ pre
127
+ {
128
+ margin-bottom: 1em;
129
+ }
130
+
131
+ .methods dt
132
+ {
133
+ width: 1em;
134
+ font-size: 1.5em;
135
+ color:#AAA;
136
+ position: absolute;
137
+ font-weight: normal;
138
+ margin: 0;
139
+ }
140
+
141
+ .methods dd
142
+ {
143
+ margin-left: 2.5em;
144
+ min-height: 1.8em;
145
+ -height: 1.8em;
146
+ padding-bottom: 0.8em;
147
+ }
148
+
149
+
150
+ .methods ul li
151
+ {
152
+ margin-right: 0.7em;
153
+ margin-left: 0;
154
+ list-style: none;
155
+ display: inline;
156
+ }
157
+
158
+ #content {
159
+ margin: 2em;
160
+ margin-left: 3.5em;
161
+ margin-right: 3.5em;
162
+ }
163
+
164
+
165
+ .sectiontitle {
166
+ margin-top: 2em;
167
+ margin-bottom: 1.3em;
168
+ margin-left: -1.2em;
169
+ font-size: 1.2em;
170
+ padding: 0 0 0.25em 0;
171
+ font-weight: bold;
172
+ border-bottom: 1px solid #000;
173
+ }
174
+
175
+ .attr-rw {
176
+ padding-right: 1em;
177
+ text-align: center;
178
+ color: #055;
179
+ }
180
+
181
+ .attr-name {
182
+ font-weight: bold;
183
+ padding-right: 1em;
184
+ }
185
+
186
+ .attr-desc {
187
+ }
188
+
189
+ tt {
190
+ font-size: 1.15em;
191
+ }
192
+
193
+ .attr-value {
194
+ font-family: monospace;
195
+ padding-left: 1em;
196
+ font-size: 1.15em;
197
+ }
198
+
199
+ .dyn-source {
200
+ display: none;
201
+ background: #fffde8;
202
+ color: #000;
203
+ border: #ffe0bb dotted 1px;
204
+ margin: 0.5em 2em 0.5em 0;
205
+ padding: 0.5em;
206
+ }
207
+
208
+ .dyn-source .cmt {
209
+ color: #00F;
210
+ font-style: italic;
211
+ }
212
+
213
+ .dyn-source .kw {
214
+ color: #070;
215
+ font-weight: bold;
216
+ }
217
+
218
+ .description pre {
219
+ padding: 0.5em;
220
+ border: #ffe0bb dotted 1px;
221
+ background: #fffde8;
222
+ }
223
+
224
+ .method {
225
+ margin-bottom: 2em;
226
+ }
227
+ .method .description,
228
+ .method .sourcecode
229
+ {
230
+ margin-left: 1.2em;
231
+ }
232
+ .method h4
233
+ {
234
+ border-bottom: 1px dotted #999;
235
+ padding: 0 0 0.2em 0;
236
+ margin-bottom: 0.8em;
237
+ font-size: 1.1em;
238
+ color:#333;
239
+ }
240
+ .method .title {
241
+ border-bottom: 1px dotted #666;
242
+ padding: 0 0 0.15em 0;
243
+ margin: 0 0 0.5em 0;
244
+ font-size: 1.2em;
245
+ line-height: 1.25em;
246
+ }
247
+
248
+ .method .sourcecode p.source-link {
249
+ text-indent: 0em;
250
+ margin-top: 0.5em;
251
+ }
252
+
253
+ .method .aka {
254
+ margin-top: 0.3em;
255
+ margin-left: 1em;
256
+ font-style: italic;
257
+ text-indent: 2em;
258
+ }
259
+
260
+ .method .source-link
261
+ {
262
+ font-size: 0.85em;
263
+ }