sdoc-templates-42floors 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/LICENSE +21 -0
  4. data/README.md +25 -0
  5. data/lib/sdoc/templates/42floors.rb +7 -0
  6. data/sdoc-templates-42floors.gemspec +20 -0
  7. data/template/rdoc/generator/template/42floors/_context.rhtml +216 -0
  8. data/template/rdoc/generator/template/42floors/_head.rhtml +7 -0
  9. data/template/rdoc/generator/template/42floors/class.rhtml +39 -0
  10. data/template/rdoc/generator/template/42floors/file.rhtml +37 -0
  11. data/template/rdoc/generator/template/42floors/index.rhtml +13 -0
  12. data/template/rdoc/generator/template/42floors/resources/apple-touch-icon.png +0 -0
  13. data/template/rdoc/generator/template/42floors/resources/css/github.css +123 -0
  14. data/template/rdoc/generator/template/42floors/resources/css/main.css +346 -0
  15. data/template/rdoc/generator/template/42floors/resources/css/panel.css +389 -0
  16. data/template/rdoc/generator/template/42floors/resources/css/reset.css +48 -0
  17. data/template/rdoc/generator/template/42floors/resources/favicon.ico +0 -0
  18. data/template/rdoc/generator/template/42floors/resources/i/arrows.png +0 -0
  19. data/template/rdoc/generator/template/42floors/resources/i/results_bg.png +0 -0
  20. data/template/rdoc/generator/template/42floors/resources/i/tree_bg.png +0 -0
  21. data/template/rdoc/generator/template/42floors/resources/js/highlight.pack.js +1 -0
  22. data/template/rdoc/generator/template/42floors/resources/js/jquery-1.3.2.min.js +19 -0
  23. data/template/rdoc/generator/template/42floors/resources/js/jquery-effect.js +593 -0
  24. data/template/rdoc/generator/template/42floors/resources/js/main.js +20 -0
  25. data/template/rdoc/generator/template/42floors/resources/js/searchdoc.js +448 -0
  26. data/template/rdoc/generator/template/42floors/resources/panel/index.html +73 -0
  27. data/template/rdoc/generator/template/42floors/search_index.rhtml +8 -0
  28. metadata +85 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8366bbc4b95b0307a085532b4b3ad59fae6216bb
4
+ data.tar.gz: 7b6f57d41844c99cb2ef37504132ea01caf22f48
5
+ SHA512:
6
+ metadata.gz: 2c1e8f9620916b4a742dabb68887bff6c4755206a43a48ce05e4c21a96dc3254963de96a91dfdbeae0d8cf9816e875f39770fe8538d5cc568072b495b6457cd8
7
+ data.tar.gz: f8d4d0e774f6997c0a77f58ca27163c36ce4b61fc2eb6ee78687ff66f86eddd2639d2d06cb2b07a966d01e9291aab3584ee30ad8a4e13b45c76964065b6e8fe1
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ .tm_properties
5
+ pkg/*
6
+ .rvmrc
7
+ coverage
8
+ doc
9
+ *#*
10
+ *~
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 42Floors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,25 @@
1
+ 42Floors SDoc Template
2
+ ======================
3
+
4
+ This contains the 42Floors [SDoc](https://github.com/voloko/sdoc) template for
5
+ use in generating Ruby Documentaiton with [RDoc](http://docs.seattlerb.org/rdoc/).
6
+
7
+ Example Useage:
8
+ ---------------
9
+
10
+ ```ruby
11
+ # ...
12
+ require 'sdoc/templates/42floors'
13
+
14
+ Rake::RDocTask.new do |rd|
15
+ rd.main = 'README.rdoc'
16
+ rd.title = 'My Documentation'
17
+ rd.rdoc_dir = 'doc'
18
+
19
+ rd.options << '-f' << 'sdoc'
20
+ rd.options << '-T' << '42floors'
21
+
22
+ rd.rdoc_files.include('README.rdoc')
23
+ rd.rdoc_files.include('lib/**/*.rb')
24
+ end
25
+ ```
@@ -0,0 +1,7 @@
1
+ $LOAD_PATH << File.expand_path(File.join(
2
+ File.dirname(__FILE__),
3
+ "..",
4
+ "..",
5
+ "..",
6
+ "template"
7
+ ))
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "sdoc-templates-42floors"
6
+ s.version = '0.2'
7
+ s.licenses = ['MIT']
8
+ s.authors = ["Jon Bracy"]
9
+ s.email = ["jon@42floors.com"]
10
+ s.homepage = "https://github.com/42floors/sdoc-templates-42floors"
11
+ s.summary = %q{42Floors SDoc template}
12
+ s.description = %q{42Floors SDoc template for RDoc}
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ s.add_runtime_dependency 'sdoc'
20
+ end
@@ -0,0 +1,216 @@
1
+ <div id="content">
2
+ <% unless (description = context.description).empty? %>
3
+ <div class="description">
4
+ <%= description %>
5
+ </div>
6
+ <% end %>
7
+
8
+
9
+ <% unless context.requires.empty? %>
10
+ <!-- File only: requires -->
11
+ <div class="sectiontitle">Required Files</div>
12
+ <ul>
13
+ <% context.requires.each do |req| %>
14
+ <li><%= h req.name %></li>
15
+ <% end %>
16
+ </ul>
17
+ <% end %>
18
+
19
+
20
+ <% sections = context.sections.select { |s| s.title }.sort_by{ |s| s.title.to_s } %>
21
+ <% unless sections.empty? then %>
22
+ <!-- Sections -->
23
+ <div class="sectiontitle">Sections</div>
24
+ <ul>
25
+ <% sections.each do |section| %>
26
+ <li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
27
+ <% end %>
28
+ </ul>
29
+ <% end %>
30
+
31
+
32
+ <% unless context.classes_and_modules.empty? %>
33
+ <!-- Namespace -->
34
+ <div class="sectiontitle">Namespace</div>
35
+ <ul>
36
+ <% (context.modules.sort + context.classes.sort).each do |mod| %>
37
+ <li>
38
+ <span class="type"><%= mod.type.upcase %></span>
39
+ <a href="<%= context.aref_to mod.path %>"><%= mod.full_name %></a>
40
+ </li>
41
+ <% end %>
42
+ </ul>
43
+ <% end %>
44
+
45
+
46
+ <% unless context.method_list.empty? %>
47
+ <!-- Method ref -->
48
+ <div class="sectiontitle">Methods</div>
49
+ <dl class="methods">
50
+ <% each_letter_group(context.method_list) do |group| %>
51
+ <dt><%= group[:name] %></dt>
52
+ <dd>
53
+ <ul>
54
+ <% group[:methods].each_with_index do |method, i| %>
55
+ <%
56
+ comma = group[:methods].size == i+1 ? '' : ','
57
+ %>
58
+ <li>
59
+ <a href="#<%= method.aref %>"><%= h method.name %></a><%= comma %>
60
+ </li>
61
+ <% end %>
62
+ </ul>
63
+ </dd>
64
+ <% end %>
65
+ </dl>
66
+ <% end %>
67
+
68
+ <% unless context.includes.empty? %>
69
+ <!-- Includes -->
70
+ <div class="sectiontitle">Included Modules</div>
71
+ <ul>
72
+ <% context.includes.each do |inc| %>
73
+ <li>
74
+ <% unless String === inc.module %>
75
+ <a href="<%= context.aref_to inc.module.path %>">
76
+ <%= h inc.module.full_name %>
77
+ </a>
78
+ <% else %>
79
+ <%= h inc.name %>
80
+ <% end %>
81
+ </li>
82
+ <% end %>
83
+ </ul>
84
+ <% end %>
85
+
86
+
87
+
88
+ <% context.each_section do |section, constants, attributes| %>
89
+
90
+ <% if section.title then %>
91
+ <div class="contenttitle" id="<%= h section.aref %>">
92
+ <%= h section.title %>
93
+ </div>
94
+ <% end %>
95
+
96
+ <% if section.comment then %>
97
+ <div class="description">
98
+ <%= section.description %>
99
+ </div>
100
+ <% end %>
101
+
102
+ <% unless constants.empty? %>
103
+ <!-- Section constants -->
104
+ <div class="sectiontitle">Constants</div>
105
+ <table border='0' cellpadding='5'>
106
+ <% context.each_constant do |const| %>
107
+ <tr valign='top'>
108
+ <td class="attr-name"><%= h const.name %></td>
109
+ <td>=</td>
110
+ <td class="attr-value"><%= h const.value %></td>
111
+ </tr>
112
+ <% if const.comment %>
113
+ <tr valign='top'>
114
+ <td>&nbsp;</td>
115
+ <td colspan="2" class="attr-desc"><%= const.description.strip %></td>
116
+ </tr>
117
+ <% end %>
118
+ <% end %>
119
+ </table>
120
+ <% end %>
121
+
122
+
123
+ <% unless attributes.empty? %>
124
+ <!-- Section attributes -->
125
+ <div class="sectiontitle">Attributes</div>
126
+ <table border='0' cellpadding='5'>
127
+ <% attributes.each do |attrib| %>
128
+ <tr valign='top'>
129
+ <td class='attr-rw'>
130
+ [<%= attrib.rw %>]
131
+ </td>
132
+ <td class='attr-name'><%= h attrib.name %></td>
133
+ <td class='attr-desc'><%= attrib.description.strip %></td>
134
+ </tr>
135
+ <% end %>
136
+ </table>
137
+ <% end %>
138
+
139
+
140
+ <!-- Methods -->
141
+ <%
142
+ context.methods_by_type(section).each do |type, visibilities|
143
+ next if visibilities.empty?
144
+
145
+ visibilities.each do |visibility, methods|
146
+ next if methods.empty?
147
+ %>
148
+ <div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
149
+ <% methods.each do |method| %>
150
+ <div class="method">
151
+ <div class="title method-title" id="<%= method.aref %>">
152
+ <% if method.call_seq %>
153
+ <b><%= method.call_seq.gsub(/->/, '&rarr;') %></b>
154
+ <% else %>
155
+ <b><%= h method.name %></b><%= h method.params %>
156
+ <% end %>
157
+ <a href="<%= "#{rel_prefix}/#{context.path}##{method.aref}"%>" name="<%= method.aref %>" class="permalink">Link</a>
158
+ </div>
159
+
160
+ <% if method.comment %>
161
+ <div class="description">
162
+ <%= method.description.strip %>
163
+ </div>
164
+ <% end %>
165
+
166
+ <% unless method.aliases.empty? %>
167
+ <div class="aka">
168
+ Also aliased as: <%= method.aliases.map do |aka|
169
+ if aka.parent then # HACK lib/rexml/encodings
170
+ %{<a href="#{context.aref_to aka.path}">#{h aka.name}</a>}
171
+ else
172
+ h aka.name
173
+ end
174
+ end.join ", " %>
175
+ </div>
176
+ <% end %>
177
+
178
+ <% if method.is_alias_for then %>
179
+ <div class="aka">
180
+ Alias for: <a href="<%= context.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
181
+ </div>
182
+ <% end %>
183
+
184
+ <% if method.token_stream %>
185
+ <% markup = method.sdoc_markup_code %>
186
+ <div class="sourcecode">
187
+ <%
188
+ # generate github link
189
+ github = if options.github
190
+ if markup =~ /File\s(\S+), line (\d+)/
191
+ path = $1
192
+ line = $2.to_i
193
+ end
194
+ path && github_url(path)
195
+ else
196
+ false
197
+ end
198
+ %>
199
+ <p class="source-link">
200
+ Source:
201
+ <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
202
+ <% if github %>
203
+ | <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
204
+ <% end %>
205
+ </p>
206
+ <div id="<%= method.aref %>_source" class="dyn-source">
207
+ <pre><%= markup %></pre>
208
+ </div>
209
+ </div>
210
+ <% end %>
211
+ </div>
212
+ <% end #methods.each %>
213
+ <% end #visibilities.each %>
214
+ <% end #context.methods_by_type %>
215
+ <% end #context.each_section %>
216
+ </div>
@@ -0,0 +1,7 @@
1
+ <link rel="stylesheet" href="<%= "#{rel_prefix}/css/reset.css" %>" type="text/css" media="screen" />
2
+ <link rel="stylesheet" href="<%= "#{rel_prefix}/css/main.css" %>" type="text/css" media="screen" />
3
+ <link rel="stylesheet" href="<%= "#{rel_prefix}/css/github.css" %>" type="text/css" media="screen" />
4
+ <script src="<%= "#{rel_prefix}/js/jquery-1.3.2.min.js" %>" type="text/javascript" charset="utf-8"></script>
5
+ <script src="<%= "#{rel_prefix}/js/jquery-effect.js" %>" type="text/javascript" charset="utf-8"></script>
6
+ <script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8"></script>
7
+ <script src="<%= "#{rel_prefix}/js/highlight.pack.js" %>" type="text/javascript" charset="utf-8"></script>
@@ -0,0 +1,39 @@
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
+ <%= include_template '_head.rhtml', {:rel_prefix => rel_prefix} %>
9
+ </head>
10
+
11
+ <body>
12
+ <div class="banner">
13
+ <% if ENV['HORO_PROJECT_NAME'] %>
14
+ <span><%= ERB::Util.html_escape(ENV['HORO_PROJECT_NAME']) %> <%= ERB::Util.html_escape(ENV['HORO_PROJECT_VERSION']) %></span><br />
15
+ <% end %>
16
+ <h1>
17
+ <span class="type"><%= klass.module? ? 'Module' : 'Class' %></span>
18
+ <%= h klass.full_name %>
19
+ <% if klass.type == 'class' %>
20
+ <span class="parent">&lt;
21
+ <% if String === klass.superclass %>
22
+ <%= klass.superclass %>
23
+ <% elsif !klass.superclass.nil? %>
24
+ <a href="<%= klass.aref_to klass.superclass.path %>"><%= h klass.superclass.full_name %></a>
25
+ <% end %>
26
+ </span>
27
+ <% end %>
28
+ </h1>
29
+ <ul class="files">
30
+ <% klass.in_files.each do |file| %>
31
+ <li><a href="<%= "#{rel_prefix}/#{h file.path}" %>"><%= h file.absolute_name %></a></li>
32
+ <% end %>
33
+ </ul>
34
+ </div>
35
+ <div id="bodyContent">
36
+ <%= include_template '_context.rhtml', {:context => klass, :rel_prefix => rel_prefix} %>
37
+ </div>
38
+ </body>
39
+ </html>
@@ -0,0 +1,37 @@
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
+ <%= include_template '_head.rhtml', {:rel_prefix => rel_prefix} %>
9
+ </head>
10
+
11
+ <body>
12
+ <div class="banner">
13
+ <% if ENV['HORO_PROJECT_NAME'] %>
14
+ <span><%= ERB::Util.html_escape(ENV['HORO_PROJECT_NAME']) %> <%= ERB::Util.html_escape(ENV['HORO_PROJECT_VERSION']) %></span><br />
15
+ <% end %>
16
+ <h1>
17
+ <%= h file.name %>
18
+ </h1>
19
+ <ul class="files">
20
+ <%
21
+ github = github_url(file.relative_name) if options.github
22
+ %>
23
+ <li>
24
+ <%= h file.relative_name %>
25
+ <% if github %>
26
+ <a href="<%= github %>" target="_blank" class="github_url">on GitHub</a>
27
+ <% end %>
28
+ </li>
29
+ <li>Last modified: <%= file.file_stat.mtime %></li>
30
+ </ul>
31
+ </div>
32
+
33
+ <div id="bodyContent">
34
+ <%= include_template '_context.rhtml', {:context => file, :rel_prefix => rel_prefix} %>
35
+ </div>
36
+ </body>
37
+ </html>
@@ -0,0 +1,13 @@
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
+ <title><%= @options.title %></title>
8
+ </head>
9
+ <frameset cols="300,*" frameborder="1" border="1" bordercolor="#999999" framespacing="1">
10
+ <frame src="panel/index.html" title="Search" name="panel" />
11
+ <frame src="<%= index_path %>" name="docwin" />
12
+ </frameset>
13
+ </html>
@@ -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
+ }