sdoc 1.0.0.rc2 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -1
  3. data/.travis.yml +12 -11
  4. data/CHANGELOG.md +31 -0
  5. data/Gemfile +1 -1
  6. data/README.md +15 -5
  7. data/Rakefile +1 -2
  8. data/bin/sdoc +1 -1
  9. data/bin/sdoc-merge +1 -1
  10. data/lib/rdoc/discover.rb +1 -1
  11. data/lib/rdoc/generator/template/rails/_context.rhtml +216 -0
  12. data/lib/rdoc/generator/template/rails/_head.rhtml +39 -0
  13. data/lib/rdoc/generator/template/rails/_panel.rhtml +14 -0
  14. data/lib/rdoc/generator/template/rails/class.rhtml +51 -0
  15. data/lib/rdoc/generator/template/rails/file.rhtml +38 -0
  16. data/lib/rdoc/generator/template/rails/index.rhtml +33 -0
  17. data/lib/rdoc/generator/template/rails/resources/apple-touch-icon.png +0 -0
  18. data/lib/rdoc/generator/template/rails/resources/css/github.css +123 -0
  19. data/lib/rdoc/generator/template/rails/resources/css/main.css +378 -0
  20. data/lib/rdoc/generator/template/rails/resources/css/panel.css +365 -0
  21. data/lib/rdoc/generator/template/rails/resources/css/reset.css +48 -0
  22. data/lib/rdoc/generator/template/rails/resources/favicon.ico +0 -0
  23. data/lib/rdoc/generator/template/rails/resources/i/arrow-down.svg +8 -0
  24. data/lib/rdoc/generator/template/rails/resources/i/arrow-right.svg +8 -0
  25. data/lib/rdoc/generator/template/rails/resources/i/search.svg +12 -0
  26. data/lib/rdoc/generator/template/rails/resources/i/tree_bg.svg +8 -0
  27. data/lib/rdoc/generator/template/rails/resources/js/highlight.pack.js +1 -0
  28. data/lib/rdoc/generator/template/rails/resources/js/jquery-3.5.1.min.js +2 -0
  29. data/lib/rdoc/generator/template/rails/resources/js/main.js +41 -0
  30. data/lib/rdoc/generator/template/rails/resources/js/searchdoc.js +493 -0
  31. data/lib/rdoc/generator/template/rails/resources/js/turbolinks.js +6 -0
  32. data/lib/rdoc/generator/template/rails/search_index.rhtml +8 -0
  33. data/lib/rdoc/generator/template/sdoc/_context.rhtml +5 -5
  34. data/lib/rdoc/generator/template/sdoc/_head.rhtml +0 -1
  35. data/lib/rdoc/generator/template/sdoc/class.rhtml +13 -0
  36. data/lib/rdoc/generator/template/sdoc/file.rhtml +0 -0
  37. data/lib/rdoc/generator/template/sdoc/index.rhtml +0 -0
  38. data/lib/rdoc/generator/template/sdoc/resources/css/main.css +11 -1
  39. data/lib/rdoc/generator/template/sdoc/resources/css/panel.css +0 -0
  40. data/lib/rdoc/generator/template/sdoc/resources/css/reset.css +0 -0
  41. data/lib/rdoc/generator/template/sdoc/resources/i/arrows.png +0 -0
  42. data/lib/rdoc/generator/template/sdoc/resources/i/results_bg.png +0 -0
  43. data/lib/rdoc/generator/template/sdoc/resources/i/tree_bg.png +0 -0
  44. data/lib/rdoc/generator/template/sdoc/resources/js/highlight.pack.js +0 -0
  45. data/lib/rdoc/generator/template/sdoc/resources/js/jquery-1.3.2.min.js +0 -0
  46. data/lib/rdoc/generator/template/sdoc/resources/js/main.js +7 -1
  47. data/lib/rdoc/generator/template/sdoc/resources/js/searchdoc.js +21 -2
  48. data/lib/rdoc/generator/template/sdoc/resources/panel/index.html +0 -0
  49. data/lib/sdoc.rb +0 -2
  50. data/lib/sdoc/generator.rb +19 -80
  51. data/lib/sdoc/github.rb +13 -14
  52. data/lib/sdoc/helpers.rb +22 -0
  53. data/lib/sdoc/templatable.rb +5 -1
  54. data/lib/sdoc/version.rb +1 -1
  55. data/sdoc.gemspec +2 -1
  56. data/spec/helpers_spec.rb +32 -0
  57. data/spec/rdoc_generator_spec.rb +8 -0
  58. metadata +27 -13
  59. data/lib/rdoc/generator/template/sdoc/resources/js/jquery-effect.js +0 -593
@@ -0,0 +1,51 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title><%= h klass.full_name %></title>
5
+ <meta charset="<%= @options.charset %>" />
6
+ <%= include_template '_head.rhtml', {:rel_prefix => rel_prefix, :tree_keys => klass.full_name.split('::') } %>
7
+
8
+ <meta property="og:title" value="<%= klass.full_name %>">
9
+
10
+ <% unless (description = klass.description).empty? %>
11
+ <% human_desc = truncate(strip_tags(description.gsub("\n", " ").strip)) %>
12
+ <meta name="description" content="<%= human_desc %>">
13
+ <meta property="og:description" content="<%= human_desc %>">
14
+ <% end %>
15
+
16
+ <meta name="keywords" content="<%= klass.full_name %> class, <%= klass.method_list.map(&:name).join(", ") %>">
17
+ </head>
18
+
19
+ <body>
20
+
21
+ <%= include_template '_panel.rhtml' %>
22
+
23
+ <div class="banner">
24
+ <% if ENV['HORO_PROJECT_NAME'] %>
25
+ <span><%= ERB::Util.html_escape(ENV['HORO_PROJECT_NAME']) %> <%= ERB::Util.html_escape(ENV['HORO_PROJECT_VERSION']) %></span><br />
26
+ <% end %>
27
+ <h1>
28
+ <span class="type"><%= klass.module? ? 'Module' : 'Class' %></span>
29
+ <%= h klass.full_name %>
30
+ <% if klass.type == 'class' %>
31
+ <span class="parent">&lt;
32
+ <% if String === klass.superclass %>
33
+ <%= klass.superclass %>
34
+ <% elsif !klass.superclass.nil? %>
35
+ <a href="<%= klass.aref_to klass.superclass.path %>"><%= h klass.superclass.full_name %></a>
36
+ <% end %>
37
+ </span>
38
+ <% end %>
39
+ </h1>
40
+ <ul class="files">
41
+ <% klass.in_files.each do |file| %>
42
+ <li><a href="<%= "#{rel_prefix}/#{h file.path}" %>"><%= h file.absolute_name %></a></li>
43
+ <% end %>
44
+ </ul>
45
+ </div>
46
+
47
+ <div id="bodyContent">
48
+ <%= include_template '_context.rhtml', {:context => klass, :rel_prefix => rel_prefix} %>
49
+ </div>
50
+ </body>
51
+ </html>
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title><%= h file.name %></title>
5
+ <meta charset="<%= @options.charset %>" />
6
+ <%= include_template '_head.rhtml', {:rel_prefix => rel_prefix, :tree_keys => [] } %>
7
+ </head>
8
+
9
+ <body>
10
+
11
+ <%= include_template '_panel.rhtml' %>
12
+
13
+ <div class="banner">
14
+ <% if ENV['HORO_PROJECT_NAME'] %>
15
+ <span><%= ERB::Util.html_escape(ENV['HORO_PROJECT_NAME']) %> <%= ERB::Util.html_escape(ENV['HORO_PROJECT_VERSION']) %></span><br />
16
+ <% end %>
17
+ <h1>
18
+ <%= h file.name %>
19
+ </h1>
20
+ <ul class="files">
21
+ <%
22
+ github = github_url(file.relative_name) if options.github
23
+ %>
24
+ <li>
25
+ <%= h file.relative_name %>
26
+ <% if github %>
27
+ <a href="<%= github %>" target="_blank" class="github_url">on GitHub</a>
28
+ <% end %>
29
+ </li>
30
+ <li>Last modified: <%= file.file_stat.mtime %></li>
31
+ </ul>
32
+ </div>
33
+
34
+ <div id="bodyContent">
35
+ <%= include_template '_context.rhtml', {:context => file, :rel_prefix => rel_prefix} %>
36
+ </div>
37
+ </body>
38
+ </html>
@@ -0,0 +1,33 @@
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 index.name %></title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= @options.charset %>" />
8
+ <%= include_template '_head.rhtml', {:rel_prefix => rel_prefix, tree_keys: []} %>
9
+ </head>
10
+
11
+ <body>
12
+
13
+ <%= include_template '_panel.rhtml' %>
14
+
15
+ <div class="banner">
16
+ <% if ENV['HORO_PROJECT_NAME'] %>
17
+ <span><%= ERB::Util.html_escape(ENV['HORO_PROJECT_NAME']) %> <%= ERB::Util.html_escape(ENV['HORO_PROJECT_VERSION']) %></span><br />
18
+ <% end %>
19
+ <h1>
20
+ <%= h index.name %>
21
+ </h1>
22
+ <ul class="files">
23
+ <li><%= h index.relative_name %></li>
24
+ <li>Last modified: <%= index.last_modified %></li>
25
+ </ul>
26
+ </div>
27
+
28
+ <div id="bodyContent">
29
+ <%= include_template '_context.rhtml', {:context => index } %>
30
+ </div>
31
+ </body>
32
+ </html>
33
+
@@ -0,0 +1,123 @@
1
+ /*
2
+
3
+ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
4
+
5
+ */
6
+
7
+ pre .comment,
8
+ pre .template_comment,
9
+ pre .diff .header,
10
+ pre .javadoc {
11
+ color: #998;
12
+ font-style: italic
13
+ }
14
+
15
+ pre .keyword,
16
+ pre .css .rule .keyword,
17
+ pre .winutils,
18
+ pre .javascript .title,
19
+ pre .lisp .title,
20
+ pre .subst {
21
+ color: #000;
22
+ font-weight: bold
23
+ }
24
+
25
+ pre .number,
26
+ pre .hexcolor {
27
+ color: #40a070
28
+ }
29
+
30
+ pre .string,
31
+ pre .tag .value,
32
+ pre .phpdoc,
33
+ pre .tex .formula {
34
+ color: #d14
35
+ }
36
+
37
+ pre .title,
38
+ pre .id {
39
+ color: #900;
40
+ font-weight: bold
41
+ }
42
+
43
+ pre .javascript .title,
44
+ pre .lisp .title,
45
+ pre .subst {
46
+ font-weight: normal
47
+ }
48
+
49
+ pre .class .title,
50
+ pre .haskell .label,
51
+ pre .tex .command {
52
+ color: #458;
53
+ font-weight: bold
54
+ }
55
+
56
+ pre .tag,
57
+ pre .tag .title,
58
+ pre .rules .property,
59
+ pre .django .tag .keyword {
60
+ color: #000080;
61
+ font-weight: normal
62
+ }
63
+
64
+ pre .attribute,
65
+ pre .variable,
66
+ pre .instancevar,
67
+ pre .lisp .body {
68
+ color: #008080
69
+ }
70
+
71
+ pre .regexp {
72
+ color: #009926
73
+ }
74
+
75
+ pre .class {
76
+ color: #458;
77
+ font-weight: bold
78
+ }
79
+
80
+ pre .symbol,
81
+ pre .ruby .symbol .string,
82
+ pre .ruby .symbol .keyword,
83
+ pre .ruby .symbol .keymethods,
84
+ pre .lisp .keyword,
85
+ pre .tex .special,
86
+ pre .input_number {
87
+ color: #990073
88
+ }
89
+
90
+ pre .builtin,
91
+ pre .built_in,
92
+ pre .lisp .title {
93
+ color: #0086b3
94
+ }
95
+
96
+ pre .preprocessor,
97
+ pre .pi,
98
+ pre .doctype,
99
+ pre .shebang,
100
+ pre .cdata {
101
+ color: #999;
102
+ font-weight: bold
103
+ }
104
+
105
+ pre .deletion {
106
+ background: #fdd
107
+ }
108
+
109
+ pre .addition {
110
+ background: #dfd
111
+ }
112
+
113
+ pre .diff .change {
114
+ background: #0086b3
115
+ }
116
+
117
+ pre .chunk {
118
+ color: #aaa
119
+ }
120
+
121
+ pre .tex .formula {
122
+ opacity: 0.5;
123
+ }
@@ -0,0 +1,378 @@
1
+ body {
2
+ font-family: "Helvetica Neue", Arial, sans-serif;
3
+ background: #FFF;
4
+ color: #3B3B3B;
5
+ margin: 0px;
6
+ font-size: 15px;
7
+ line-height: 1.25em;
8
+ }
9
+
10
+ .banner, #bodyContent {
11
+ margin-left: 300px;
12
+ }
13
+
14
+ a:link, a:active, a:visited, a:hover {
15
+ color: #CC0000;
16
+ text-decoration: none;
17
+ }
18
+
19
+ a:hover {
20
+ color: #990000;
21
+ text-decoration: underline;
22
+ }
23
+
24
+ .banner a:hover {
25
+ color: white;
26
+ }
27
+
28
+ h1 a, h2 a, .banner a {
29
+ color: #fff;
30
+ }
31
+
32
+ h1 a:hover, h2 a:hover {
33
+ color: #fff;
34
+ }
35
+
36
+ p {
37
+ margin-bottom: 1em;
38
+ text-align: justify;
39
+ }
40
+
41
+ h1 {
42
+ font-size: 2.1em;
43
+ font-weight: normal;
44
+ line-height: 1.2em;
45
+ margin: 1.4em 0 0.7em 0;
46
+ }
47
+
48
+ h2 {
49
+ font-size: 1.6em;
50
+ margin: 1.8em 0 0.8em 0;
51
+ font-weight: normal;
52
+ line-height: 1.2em;
53
+ }
54
+
55
+ h3 {
56
+ font-size: 1.4em;
57
+ color:#555;
58
+ margin: 1.4em 0 0.7em 0;
59
+ font-weight: normal;
60
+ }
61
+
62
+ h4 {
63
+ margin: 1.4em 0 0.5em 0;
64
+ font-size: 1em;
65
+ }
66
+
67
+ table
68
+ {
69
+ margin-bottom: 1em;
70
+ }
71
+
72
+ td, th
73
+ {
74
+ padding: 0 0.7em 0.3em 0;
75
+ }
76
+
77
+ th
78
+ {
79
+ font-weight: bold;
80
+ }
81
+
82
+ .clear
83
+ {
84
+ clear: both;
85
+ width: 0; height: 0;
86
+ }
87
+
88
+ dt
89
+ {
90
+ margin-bottom: 0.3em;
91
+ font-weight: bold;
92
+ }
93
+
94
+ dd
95
+ {
96
+ margin-left: 2em;
97
+ margin-bottom: 1em;
98
+ }
99
+
100
+ dd p
101
+ {
102
+ margin-top: 0.6em;
103
+ }
104
+
105
+ li
106
+ {
107
+ margin: 0 0 0.5em 2em;
108
+ }
109
+
110
+ ul li
111
+ {
112
+ list-style: disc;
113
+ }
114
+
115
+ ol li
116
+ {
117
+ list-style: decimal;
118
+ }
119
+
120
+ .banner
121
+ {
122
+ background: #B61D1D;
123
+ color: #FFF;
124
+ border-bottom: 1px solid #9b281c;
125
+ padding: 1em;
126
+ box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
127
+ }
128
+ .banner h1
129
+ {
130
+ font-size: 1.2em;
131
+ margin: 0;
132
+ }
133
+
134
+ .banner h1 .type
135
+ {
136
+ font-size: 0.833em;
137
+ display:block;
138
+ }
139
+
140
+ .banner h1 .type,
141
+ .banner h1 .parent
142
+ {
143
+ color: #CCC;
144
+ }
145
+
146
+ .banner ul
147
+ {
148
+ margin-top: 0.3em;
149
+ margin-bottom: 0;
150
+ font-size: 0.85em;
151
+ }
152
+
153
+ .banner li
154
+ {
155
+ list-style: none;
156
+ margin-left: 0;
157
+ margin-bottom: 0;
158
+ }
159
+
160
+ .banner .github_url {
161
+ color: #CCC;
162
+ }
163
+
164
+ pre
165
+ {
166
+ margin-bottom: 1em;
167
+ }
168
+
169
+ .methods dt
170
+ {
171
+ width: 1em;
172
+ font-size: 1.5em;
173
+ color:#AAA;
174
+ position: absolute;
175
+ font-weight: normal;
176
+ margin: 0;
177
+ }
178
+
179
+ .methods dd
180
+ {
181
+ margin-left: 2.5em;
182
+ min-height: 1.8em;
183
+ -height: 1.8em;
184
+ padding-bottom: 0.8em;
185
+ }
186
+
187
+
188
+ .methods ul li
189
+ {
190
+ margin-right: 0.7em;
191
+ margin-left: 0;
192
+ list-style: none;
193
+ display: inline;
194
+ }
195
+
196
+ #content {
197
+ margin: 2em;
198
+ margin-left: 3.5em;
199
+ margin-right: 3.5em;
200
+ max-width: 980px;
201
+ }
202
+
203
+
204
+ .sectiontitle {
205
+ margin-top: 2em;
206
+ margin-bottom: 1.3em;
207
+ margin-left: -1.2em;
208
+ font-size: 1.2em;
209
+ padding: 0 0 0.25em 0;
210
+ font-weight: bold;
211
+ border-bottom: 1px solid #000;
212
+ }
213
+
214
+ .contenttitle {
215
+ margin-top: 4em;
216
+ margin-bottom: 1.3em;
217
+ margin-left: -0.9em;
218
+ font-size: 1.6em;
219
+ padding: 0 0 0.25em 0;
220
+ font-weight: bold;
221
+ }
222
+
223
+ .attr-rw {
224
+ padding-right: 1em;
225
+ text-align: center;
226
+ color: #055;
227
+ }
228
+
229
+ .attr-name {
230
+ font-weight: bold;
231
+ padding-right: 1em;
232
+ }
233
+
234
+ .attr-desc {
235
+ }
236
+
237
+ tt {
238
+ font-size: 1.15em;
239
+ }
240
+
241
+ .attr-value {
242
+ font-family: monospace;
243
+ padding-left: 1em;
244
+ font-size: 1.15em;
245
+ }
246
+
247
+ .dyn-source {
248
+ display: none;
249
+ background: #fffde8;
250
+ color: #000;
251
+ border: #ffe0bb dotted 1px;
252
+ margin: 0.5em 2em 0.5em 0;
253
+ padding: 0.5em;
254
+ }
255
+
256
+ .dyn-source .cmt {
257
+ color: #00F;
258
+ font-style: italic;
259
+ }
260
+
261
+ .dyn-source .kw {
262
+ color: #070;
263
+ font-weight: bold;
264
+ }
265
+
266
+ .description pre {
267
+ padding: 0.5em;
268
+ background: #EEEEEE;
269
+ font-size: 15px;
270
+ overflow-x: scroll;
271
+ }
272
+
273
+ .method {
274
+ margin-bottom: 2em;
275
+ }
276
+ .method .description,
277
+ .method .sourcecode
278
+ {
279
+ margin-left: 1.2em;
280
+ }
281
+ .method h4
282
+ {
283
+ border-bottom: 1px dotted #999;
284
+ padding: 0 0 0.2em 0;
285
+ margin-bottom: 0.8em;
286
+ font-size: 1.1em;
287
+ color:#333;
288
+ }
289
+ .method .method-title {
290
+ border-bottom: 1px dotted #666;
291
+ padding: 0 0 0.15em 0;
292
+ margin: 0 0 0.5em 0;
293
+ font-size: 1.2em;
294
+ line-height: 1.25em;
295
+ position: relative;
296
+ }
297
+
298
+ .method .method-title a.permalink {
299
+ position: absolute;
300
+ font-size: 0.75em;
301
+ right: 0;
302
+ }
303
+
304
+ .method .sourcecode p.source-link {
305
+ text-indent: 0em;
306
+ margin-top: 0.5em;
307
+ }
308
+
309
+ .method .aka {
310
+ margin-top: 0.3em;
311
+ margin-left: 1em;
312
+ font-style: italic;
313
+ text-indent: 2em;
314
+ }
315
+
316
+ .method .source-link
317
+ {
318
+ font-size: 0.85em;
319
+ }
320
+
321
+ .ruby-constant {
322
+ color: teal;
323
+ }
324
+ .ruby-keyword {
325
+ color: #000;
326
+ font-weight: bold
327
+ }
328
+ .ruby-title {
329
+ color: #900;
330
+ font-weight: bold;
331
+ }
332
+ .ruby-ivar {
333
+ color: teal;
334
+ }
335
+ .ruby-operator {
336
+ color: #000;
337
+ font-weight: bold
338
+ }
339
+ .ruby-identifier {
340
+ color: #000;
341
+ }
342
+ .ruby-string,
343
+ .ruby-node {
344
+ color: #D14;
345
+ }
346
+ .ruby-comment {
347
+ color: #998;
348
+ font-style: italic;
349
+ }
350
+ .ruby-regexp {
351
+ color: #009926;
352
+ }
353
+ .ruby-value {
354
+ color: #990073;
355
+ }
356
+ .ruby-number {
357
+ color: #40A070;
358
+ }
359
+
360
+ @keyframes highlight {
361
+ from { background-color: yellow; }
362
+ to { background-color: white; }
363
+ }
364
+
365
+ .highlight {
366
+ animation-name: highlight;
367
+ animation-duration: 1s;
368
+ }
369
+
370
+ p code {
371
+ background: #eeeeee;
372
+ border-radius: 2px;
373
+ border: 1px solid #dddddd;
374
+ font-family: Consolas, Menlo, Courier, monospace;
375
+ font-size: 14px;
376
+ margin-bottom: 1px;
377
+ padding: 0 5px;
378
+ }