sdoc 0.3.0 → 0.3.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 (29) hide show
  1. data/lib/sdoc/generator.rb +34 -11
  2. data/lib/sdoc/generator/template/direct/_context.rhtml +1 -1
  3. data/lib/sdoc/generator/template/direct/_head.rhtml +7 -0
  4. data/lib/sdoc/generator/template/direct/class.rhtml +4 -5
  5. data/lib/sdoc/generator/template/direct/file.rhtml +4 -5
  6. data/lib/sdoc/generator/template/direct/index.rhtml +1 -2
  7. data/lib/sdoc/generator/template/direct/resources/css/github.css +129 -0
  8. data/lib/sdoc/generator/template/direct/resources/js/highlight.pack.js +1 -0
  9. data/lib/sdoc/generator/template/direct/resources/js/main.js +15 -13
  10. data/lib/sdoc/generator/template/direct/resources/panel/index.html +32 -31
  11. data/lib/sdoc/generator/template/direct/se_index.rhtml +8 -0
  12. data/sdoc.gemspec +2 -2
  13. metadata +8 -20
  14. data/lib/sdoc/generator/template/shtml/_context.rhtml +0 -163
  15. data/lib/sdoc/generator/template/shtml/class.rhtml +0 -46
  16. data/lib/sdoc/generator/template/shtml/file.rhtml +0 -37
  17. data/lib/sdoc/generator/template/shtml/index.rhtml +0 -14
  18. data/lib/sdoc/generator/template/shtml/resources/apple-touch-icon.png +0 -0
  19. data/lib/sdoc/generator/template/shtml/resources/css/main.css +0 -191
  20. data/lib/sdoc/generator/template/shtml/resources/css/panel.css +0 -383
  21. data/lib/sdoc/generator/template/shtml/resources/css/reset.css +0 -53
  22. data/lib/sdoc/generator/template/shtml/resources/favicon.ico +0 -0
  23. data/lib/sdoc/generator/template/shtml/resources/i/arrows.png +0 -0
  24. data/lib/sdoc/generator/template/shtml/resources/i/results_bg.png +0 -0
  25. data/lib/sdoc/generator/template/shtml/resources/i/tree_bg.png +0 -0
  26. data/lib/sdoc/generator/template/shtml/resources/js/jquery-1.3.2.min.js +0 -19
  27. data/lib/sdoc/generator/template/shtml/resources/js/main.js +0 -34
  28. data/lib/sdoc/generator/template/shtml/resources/js/searchdoc.js +0 -628
  29. data/lib/sdoc/generator/template/shtml/resources/panel/index.html +0 -71
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdoc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Vladimir Kolesnikov
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-05 00:00:00 -07:00
18
+ date: 2011-09-24 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -70,10 +70,12 @@ files:
70
70
  - lib/sdoc.rb
71
71
  - lib/sdoc/generator.rb
72
72
  - lib/sdoc/generator/template/direct/_context.rhtml
73
+ - lib/sdoc/generator/template/direct/_head.rhtml
73
74
  - lib/sdoc/generator/template/direct/class.rhtml
74
75
  - lib/sdoc/generator/template/direct/file.rhtml
75
76
  - lib/sdoc/generator/template/direct/index.rhtml
76
77
  - lib/sdoc/generator/template/direct/resources/apple-touch-icon.png
78
+ - lib/sdoc/generator/template/direct/resources/css/github.css
77
79
  - lib/sdoc/generator/template/direct/resources/css/main.css
78
80
  - lib/sdoc/generator/template/direct/resources/css/panel.css
79
81
  - lib/sdoc/generator/template/direct/resources/css/reset.css
@@ -81,28 +83,14 @@ files:
81
83
  - lib/sdoc/generator/template/direct/resources/i/arrows.png
82
84
  - lib/sdoc/generator/template/direct/resources/i/results_bg.png
83
85
  - lib/sdoc/generator/template/direct/resources/i/tree_bg.png
86
+ - lib/sdoc/generator/template/direct/resources/js/highlight.pack.js
84
87
  - lib/sdoc/generator/template/direct/resources/js/jquery-1.3.2.min.js
85
88
  - lib/sdoc/generator/template/direct/resources/js/jquery-effect.js
86
89
  - lib/sdoc/generator/template/direct/resources/js/main.js
87
90
  - lib/sdoc/generator/template/direct/resources/js/searchdoc.js
88
91
  - lib/sdoc/generator/template/direct/resources/panel/index.html
92
+ - lib/sdoc/generator/template/direct/se_index.rhtml
89
93
  - lib/sdoc/generator/template/merge/index.rhtml
90
- - lib/sdoc/generator/template/shtml/_context.rhtml
91
- - lib/sdoc/generator/template/shtml/class.rhtml
92
- - lib/sdoc/generator/template/shtml/file.rhtml
93
- - lib/sdoc/generator/template/shtml/index.rhtml
94
- - lib/sdoc/generator/template/shtml/resources/apple-touch-icon.png
95
- - lib/sdoc/generator/template/shtml/resources/css/main.css
96
- - lib/sdoc/generator/template/shtml/resources/css/panel.css
97
- - lib/sdoc/generator/template/shtml/resources/css/reset.css
98
- - lib/sdoc/generator/template/shtml/resources/favicon.ico
99
- - lib/sdoc/generator/template/shtml/resources/i/arrows.png
100
- - lib/sdoc/generator/template/shtml/resources/i/results_bg.png
101
- - lib/sdoc/generator/template/shtml/resources/i/tree_bg.png
102
- - lib/sdoc/generator/template/shtml/resources/js/jquery-1.3.2.min.js
103
- - lib/sdoc/generator/template/shtml/resources/js/main.js
104
- - lib/sdoc/generator/template/shtml/resources/js/searchdoc.js
105
- - lib/sdoc/generator/template/shtml/resources/panel/index.html
106
94
  - lib/sdoc/github.rb
107
95
  - lib/sdoc/helpers.rb
108
96
  - lib/sdoc/merge.rb
@@ -1,163 +0,0 @@
1
- <div id="content">
2
- <% unless (desc = context.description).empty? %>
3
- <div class="description"><%= desc %></div>
4
- <% end %>
5
-
6
- <% unless context.requires.empty? %>
7
- <div class="sectiontitle">Required Files</div>
8
- <ul>
9
- <% context.requires.each do |req| %>
10
- <li><%= h req.name %></li>
11
- <% end %>
12
- </ul>
13
- <% end %>
14
-
15
- <% sections = context.sections.select { |section| section.title } %>
16
- <% unless sections.empty? %>
17
- <div class="sectiontitle">Contents</div>
18
- <ul>
19
- <% sections.each do |section| %>
20
- <li><a href="#<%= section.sequence %>"><%= h section.title %></a></li>
21
- <% end %>
22
- </ul>
23
- <% end %>
24
-
25
- <%
26
- list = context.method_list
27
- list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
28
- %>
29
- <% unless list.empty? %>
30
- <div class="sectiontitle">Methods</div>
31
- <ul>
32
- <% list.sort{ |a, b| a.name <=> b.name }.each do |method| %>
33
- <li><a href="#<%= method.aref %>"><%= method.name %></a></li>
34
- <% end %>
35
- </ul>
36
- <% end %>
37
-
38
- <% unless context.includes.empty? %>
39
- <div class="sectiontitle">Included Modules</div>
40
- <ul>
41
- <% context.includes.each do |inc| %>
42
- <li>
43
- <% unless String === inc.module %>
44
- <a href="<%= context.aref_to inc.module.path %>"><%= h inc.module.full_name %></a>
45
- <% else %>
46
- <span><%= h inc.name %></span>
47
- <% end %>
48
- START:includes
49
- </li>
50
- <% end %>
51
- </ul>
52
- <% end %>
53
-
54
- <% sections.each do |section| %>
55
- <div class="sectiontitle"><a name="<%= h section.sequence %>"><%= h section.title %></a></div>
56
- <% unless (description = section.description).empty? %>
57
- <div class="description">
58
- <%= description %>
59
- </div>
60
- <% end %>
61
- <% end %>
62
-
63
- <% unless context.classes_and_modules.empty? %>
64
- <div class="sectiontitle">Classes and Modules</div>
65
- <ul>
66
- <% (context.modules.sort + context.classes.sort).each do |mod| %>
67
- <li><span class="type"><%= mod.type.upcase %></span> <a href="<%= context.aref_to mod.path %>"><%= mod.full_name %></a></li>
68
- <% end %>
69
- </ul>
70
- <% end %>
71
-
72
- <% unless context.constants.empty? %>
73
- <div class="sectiontitle">Constants</div>
74
- <table border='0' cellpadding='5'>
75
- <% context.each_constant do |const| %>
76
- <tr valign='top'>
77
- <td class="attr-name"><%= h const.name %></td>
78
- <td>=</td>
79
- <td class="attr-value"><%= h const.value %></td>
80
- </tr>
81
- <% unless (description = const.description).empty? %>
82
- <tr valign='top'>
83
- <td>&nbsp;</td>
84
- <td colspan="2" class="attr-desc"><%= description %></td>
85
- </tr>
86
- <% end %>
87
- <% end %>
88
- </table>
89
- <% end %>
90
-
91
- <% unless context.attributes.empty? %>
92
- <div class="sectiontitle">Attributes</div>
93
- <table border='0' cellpadding='5'>
94
- <% context.each_attribute do |attrib| %>
95
- <tr valign='top'>
96
- <td class='attr-rw'>
97
- [<%= attrib.rw %>]
98
- </td>
99
- <td class='attr-name'><%= h attrib.name %></td>
100
- <td class='attr-desc'><%= attrib.description.strip %></td>
101
- </tr>
102
- <% end %>
103
- </table>
104
- <% end %>
105
-
106
- <% context.methods_by_type.each do |type, visibilities|
107
- next if visibilities.empty?
108
- visibilities.each do |visibility, methods|
109
- next if methods.empty?
110
- next unless visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
111
- %>
112
- <div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
113
- <% methods.each do |method| %>
114
- <div class="method">
115
- <div class="title">
116
- <% if method.call_seq %>
117
- <a name="<%= method.aref %>"></a><b><%= method.call_seq.gsub(/->/, '&rarr;') %></b>
118
- <% else %>
119
- <a name="<%= method.aref %>"></a><b><%= h method.name %></b><%= h method.params %>
120
- <% end %>
121
- </div>
122
- <% unless (description = method.description).empty? %>
123
- <div class="description">
124
- <%# TODO delete this dirty hack when documentation for example for JavaScriptHelper will not be cutted off by <script> tag %>
125
- <%= description.gsub('<script>'){ |m| h(m) } %>
126
- </div>
127
- <% end %>
128
- <% unless method.aliases.empty? %>
129
- <div class="aka">
130
- This method is also aliased as
131
- <% method.aliases.each do |aka| %>
132
- <a href="<%= context.aref_to aka.path %>"><%= h aka.name %></a>
133
- <% end %>
134
- </div>
135
- <% end %>
136
- <% if method.token_stream %>
137
- <% markup = method.markup_code %>
138
- <div class="sourcecode">
139
- <p class="source-link">
140
- Source: <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
141
- <%
142
- if options.github
143
- if markup =~ /File\s(\S+), line (\d+)/
144
- path = $1
145
- line = $2.to_i
146
- end
147
- github = github_url(path)
148
- if github
149
- %>
150
- | <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
151
- <% end end %>
152
- </p>
153
- <div id="<%= method.aref %>_source" class="dyn-source">
154
- <pre><%= method.markup_code %></pre>
155
- </div>
156
- </div>
157
- <% end %>
158
- </div>
159
- <% end
160
- end
161
- end
162
- %>
163
- </div>
@@ -1,46 +0,0 @@
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/main.css" %>" type="text/css" media="screen" />
9
- <script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8"></script>
10
- </head>
11
-
12
- <body>
13
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'>
14
- <tr>
15
- <td class="file-title"><span class="file-title-prefix"><%= klass.module? ? 'Module' : 'Class' %></span><br /><%= h klass.full_name %></td>
16
- <td align="right">
17
- <table cellspacing="0" cellpadding="2">
18
- <tr valign="top">
19
- <td>In:</td>
20
- <td>
21
- <% klass.in_files.each do |file| %>
22
- <a href="<%= "#{rel_prefix}/#{h file.path}" %>"><%= h file.absolute_name %></a>
23
- <% end %>
24
- </td>
25
- </tr>
26
- <% if klass.type == 'class' %>
27
- <tr>
28
- <td>Parent:</td>
29
- <td>
30
- <% if String === klass.superclass %>
31
- <%= klass.superclass %>
32
- <% elsif !klass.superclass.nil? %>
33
- <a href="<%= klass.aref_to klass.superclass.path %>"><%= h klass.superclass.full_name %></a>
34
- <% end %>
35
- </td>
36
- </tr>
37
- <% end %>
38
- </table>
39
- </td>
40
- </tr>
41
- </table>
42
- <div id="bodyContent">
43
- <%= include_template '_context.rhtml', {:context => klass, :rel_prefix => rel_prefix} %>
44
- </div>
45
- </body>
46
- </html>
@@ -1,37 +0,0 @@
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/main.css" %>" type="text/css" media="screen" />
9
- <script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8"></script>
10
- </head>
11
-
12
- <body>
13
- <table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>
14
- <tr><td>
15
- <table width="100%" border='0' cellpadding='0' cellspacing='0'><tr>
16
- <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br /><%= h file.name %></td>
17
- <td align="right">
18
- <table border='0' cellspacing="0" cellpadding="2">
19
- <tr>
20
- <td>Path:</td>
21
- <td><%= h file.relative_name %></td>
22
- </tr>
23
- <tr>
24
- <td>Modified:</td>
25
- <td><%= file.file_stat.mtime %></td>
26
- </tr>
27
- </table>
28
- </td></tr>
29
- </table>
30
- </td></tr>
31
- </table><br />
32
-
33
- <div id="bodyContent">
34
- <%= include_template '_context.rhtml', {:context => file, :rel_prefix => rel_prefix} %>
35
- </div>
36
- </body>
37
- </html>
@@ -1,14 +0,0 @@
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>
@@ -1,191 +0,0 @@
1
- a {
2
- color: #00F;
3
- text-decoration: none;
4
- }
5
-
6
- a:hover {
7
- color: #77F;
8
- text-decoration: underline;
9
- }
10
-
11
- body, td, p {
12
- font-family: "Bitstream Vera Sans", Verdana, Arial, Helvetica, sans-serif;
13
- background: #FFF;
14
- color: #000;
15
- margin: 0px;
16
- font-size: small;
17
- }
18
-
19
- p {
20
- margin-top: 0.5em;
21
- margin-bottom: 0.5em;
22
- }
23
-
24
- #content {
25
- margin: 2em;
26
- margin-left: 3.5em;
27
- margin-right: 3.5em;
28
- }
29
-
30
- #description p {
31
- margin-bottom: 0.5em;
32
- }
33
-
34
- .sectiontitle {
35
- margin-top: 1em;
36
- margin-bottom: 1em;
37
- padding: 0.5em;
38
- padding-left: 2em;
39
- background: #005;
40
- color: #FFF;
41
- font-weight: bold;
42
- }
43
-
44
- .attr-rw {
45
- padding-left: 1em;
46
- padding-right: 1em;
47
- text-align: center;
48
- color: #055;
49
- }
50
-
51
- .attr-name {
52
- font-weight: bold;
53
- }
54
-
55
- .attr-desc {
56
- }
57
-
58
- .attr-desc p {
59
- margin-top: 0;
60
- }
61
-
62
- .attr-value {
63
- font-family: monospace;
64
- }
65
-
66
- .file-title-prefix {
67
- font-size: large;
68
- }
69
-
70
- .file-title {
71
- font-size: large;
72
- font-weight: bold;
73
- background: #005;
74
- color: #FFF;
75
- }
76
-
77
- .banner {
78
- background: #005;
79
- color: #FFF;
80
- border: 1px solid black;
81
- padding: 1em;
82
- }
83
-
84
- .banner td {
85
- background: transparent;
86
- color: #FFF;
87
- }
88
-
89
- h1 a, h2 a, .sectiontitle a, .banner a {
90
- color: #FF0;
91
- }
92
-
93
- h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover {
94
- color: #FF7;
95
- }
96
-
97
- .dyn-source {
98
- display: none;
99
- background: #fffde8;
100
- color: #000;
101
- border: #ffe0bb dotted 1px;
102
- margin: 0.5em 2em 0.5em 2em;
103
- padding: 0.5em;
104
- }
105
-
106
- .dyn-source .cmt {
107
- color: #00F;
108
- font-style: italic;
109
- }
110
-
111
- .dyn-source .kw {
112
- color: #070;
113
- font-weight: bold;
114
- }
115
-
116
- .method {
117
- margin-left: 1em;
118
- margin-right: 1em;
119
- margin-bottom: 1em;
120
- }
121
-
122
- .description pre {
123
- padding: 0.5em;
124
- border: #ffe0bb dotted 1px;
125
- background: #fffde8;
126
- }
127
-
128
- .method .title {
129
- font-family: monospace;
130
- font-size: large;
131
- border-bottom: 1px dashed black;
132
- margin-bottom: 0.3em;
133
- padding-bottom: 0.1em;
134
- }
135
-
136
- .method .description, .method .sourcecode {
137
- margin-left: 1em;
138
- }
139
-
140
- .description p, .sourcecode p {
141
- margin-bottom: 0.5em;
142
- }
143
-
144
- .method .sourcecode p.source-link {
145
- text-indent: 0em;
146
- margin-top: 0.5em;
147
- }
148
-
149
- .method .aka {
150
- margin-top: 0.3em;
151
- margin-left: 1em;
152
- font-style: italic;
153
- text-indent: 2em;
154
- }
155
-
156
- h1 {
157
- padding: 1em;
158
- margin-left: -1.5em;
159
- font-size: x-large;
160
- font-weight: bold;
161
- color: #FFF;
162
- background: #007;
163
- }
164
-
165
- h2 {
166
- padding: 0.5em 1em 0.5em 1em;
167
- margin-left: -1.5em;
168
- font-size: large;
169
- font-weight: bold;
170
- color: #FFF;
171
- background: #009;
172
- }
173
-
174
- h3, h4, h5, h6 {
175
- color: #220088;
176
- border-bottom: #5522bb solid 1px;
177
- }
178
-
179
- .sourcecode > pre {
180
- padding: 0.5em;
181
- border: 1px dotted black;
182
- background: #FFE;
183
- }
184
-
185
- dt {
186
- font-weight: bold
187
- }
188
-
189
- dd {
190
- margin-bottom: 0.7em;
191
- }