rdoc-generator-sixfish 0.3.1 → 0.5.0.pre20180710102525

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.editorconfig +16 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/ChangeLog +675 -0
  7. data/History.md +20 -16
  8. data/Manifest.txt +29 -0
  9. data/README.md +24 -30
  10. data/data/rdoc-generator-sixfish/css/sixfish.css +1184 -2
  11. data/data/rdoc-generator-sixfish/css/sixfish.css.map +7 -1
  12. data/data/rdoc-generator-sixfish/fa/light.js +0 -0
  13. data/data/rdoc-generator-sixfish/fa/light.svg +0 -0
  14. data/data/rdoc-generator-sixfish/fa/loader.js +1 -0
  15. data/data/rdoc-generator-sixfish/fa/regular.js +1 -0
  16. data/data/rdoc-generator-sixfish/fa/regular.svg +662 -0
  17. data/data/rdoc-generator-sixfish/fa/solid.js +1 -0
  18. data/data/rdoc-generator-sixfish/fa/solid.svg +662 -0
  19. data/data/rdoc-generator-sixfish/images/glyphicons-28-search.png +0 -0
  20. data/data/rdoc-generator-sixfish/js/jquery-3.1.1.js +10220 -0
  21. data/data/rdoc-generator-sixfish/js/sixfish.min.js +99 -0
  22. data/data/rdoc-generator-sixfish/templates/class.tmpl +180 -179
  23. data/data/rdoc-generator-sixfish/templates/file.tmpl +16 -4
  24. data/data/rdoc-generator-sixfish/templates/index.tmpl +48 -77
  25. data/data/rdoc-generator-sixfish/templates/layout.tmpl +51 -71
  26. data/lib/rdoc/discover.rb +1 -1
  27. data/lib/rdoc/generator/sixfish.rb +66 -45
  28. data/lib/sixfish.rb +9 -10
  29. data/spec/rdoc/generator/sixfish_spec.rb +16 -22
  30. data/spec/sixfish_spec.rb +5 -1
  31. data.tar.gz.sig +3 -2
  32. metadata +163 -63
  33. metadata.gz.sig +0 -0
  34. data/data/rdoc-generator-sixfish/css/fa-solid-900.515704be.ttf +0 -0
  35. data/data/rdoc-generator-sixfish/css/fa-solid-900.7ba04835.svg +0 -1
  36. data/data/rdoc-generator-sixfish/css/fa-solid-900.8c589fd1.eot +0 -0
  37. data/data/rdoc-generator-sixfish/css/fa-solid-900.c7b072c6.woff +0 -0
  38. data/data/rdoc-generator-sixfish/css/fa-solid-900.f2049a98.woff2 +0 -0
  39. data/data/rdoc-generator-sixfish/js/sixfish.js +0 -39
  40. data/data/rdoc-generator-sixfish/js/sixfish.js.map +0 -1
  41. data/lib/inversion/template/striptag.rb +0 -42
  42. data/lib/sixfish/patches.rb +0 -73
@@ -1,211 +1,212 @@
1
1
  <?import rel_prefix, modsort, files ?>
2
2
 
3
- <header>
4
- <?if klass.parent ?>
5
- <?if klass.full_name.index('::') ?>
6
- <h2 class="namespace">
7
- <?call klass.full_name.sub(/^(.*::).*/, '\1') ?>
8
- </h2>
9
- <?end if ?>
10
- <h1 class="[?call klass.type ?] title is-1">
11
- <span class="name"><?call klass.name ?></span>
12
- <span class="tag is-info"><?call klass.type ?></span>
13
- </h1>
14
- <?end if ?>
15
- </header>
16
-
17
- <table class="class-metadata table box">
18
- <tbody>
19
- <?unless klass.module? ?>
20
- <tr>
21
- <td>Superclass</td>
22
- <?if klass.superclass.respond_to?(:path) ?>
23
- <td class="superclass"><a href="[?attr rel_prefix ?]/[?call klass.superclass.path ?]"><?call
24
- klass.superclass.full_name ?></a></td>
25
- <?else?>
26
- <td class="superclass"><?call klass.superclass ?></td>
27
- <?end if ?>
28
- </tr>
29
- <?end unless ?>
30
-
31
- <?unless klass.includes.empty? ?>
32
- <tr>
33
- <td>Included Modules</td>
34
- <td class="included-modules">
35
- <ul>
36
- <?for inc in klass.includes ?>
37
- <?if inc.module.respond_to?(:path) ?>
38
- <li class="include"><a href="[?call klass.aref_to(inc.module.path) ?]"><?call
39
- inc.module.full_name ?></a></li>
40
- <?else ?>
41
- <li class="include"><?call inc.name ?></li>
3
+ <div class="row">
4
+ <div class="one-half column">
5
+
6
+ <header class="hero-unit">
7
+ <hgroup>
8
+ <?if klass.parent ?>
9
+ <?if klass.full_name.index('::') ?>
10
+ <h2 class="namespace">
11
+ <?call klass.full_name.sub(/^(.*::).*/, '\1') ?>
12
+ </h2>
42
13
  <?end if ?>
43
- <?end for ?>
44
- </ul>
45
- </td>
46
- </tr>
47
- <?end unless ?>
48
-
49
- <?unless klass.extends.empty? ?>
50
- <tr>
51
- <td>Extended With</td>
52
- <td class="extended-modules">
53
- <ul>
54
- <?for ext in klass.extends.uniq ?>
55
- <?if ext.module.respond_to?(:path) ?>
56
- <li class="extend"><a href="[?call klass.aref_to(ext.module.path) ?]"><?call
57
- ext.module.full_name ?></a></li>
58
- <?else ?>
59
- <li class="extend"><?call ext.name ?></li>
60
- <?end if ?>
61
- <?end for ?>
62
- </td>
63
- </tr>
64
- <?end unless ?>
65
-
66
- </tbody>
67
- </table>
68
-
69
- <?call klass.description ?>
70
- </section>
71
-
72
-
73
- <section class="api content">
74
-
75
- <?for section, constants, attrs in klass.each_section ?>
76
- <div id="<?call section.aref ?>">
77
- <?if section.title ?>
78
- <header>
79
- <h3 class="title is-3"><?call section.title ?></h3>
80
- <span class="section-click-top">
81
- <a href="#top">&uarr; top</a>
82
- </span>
14
+ <?end if ?>
15
+ <?if klass.in_files.empty? ?>
16
+ <h1 class="[?call klass.type ?]"><?call klass.name ?></h1>
17
+ <?else?>
18
+ <h1 class="[?call klass.type ?]"
19
+ title="In files: "
20
+ data-tooltip="[?call klass.in_files.map {|f| f.full_name }.join(', ') ?]"
21
+ ><span class="name"><?call klass.name ?></span></h1>
22
+ <?end if ?>
23
+ </hgroup>
24
+ <span class="label"><?call klass.type ?></span>
83
25
  </header>
84
- <?end if ?>
85
-
86
- <?if section.comment ?>
87
- <p class="description">
88
- <?call section.description ?>
89
- </p>
90
- <?end if ?>
91
26
 
92
- <?if constants.any?{|c| c.display? } ?>
93
- <!-- Constants -->
94
- <section class="constants-list">
95
- <header>
96
- <h3>Constants</h3>
97
- </header>
27
+ <section class="description">
28
+ <?call klass.description ?>
29
+ </section>
30
+ </div>
31
+
32
+ <div class="one-half column">
33
+ <section class="module-relations">
34
+ <dl>
35
+ <?unless klass.module? ?>
36
+ <dt>Superclass</dt>
37
+ <?if klass.superclass.respond_to?(:path) ?>
38
+ <dd class="superclass"><a href="[?attr rel_prefix ?]/[?call klass.superclass.path ?]"><?call
39
+ klass.superclass.full_name ?></a></dd>
40
+ <?else?>
41
+ <dd class="superclass"><?call klass.superclass ?></dd>
42
+ <?end if ?>
43
+ <?end unless ?>
98
44
 
99
- <dl class="constants">
100
- <?for const in constants.select {|c| c.display? } ?>
101
- <dt id="[?call const.name ?]"><i class="icon-generic"></i><?call const.name ?></dt>
102
- <?if const.comment ?>
103
- <dd class="description"><?call const.description.strip ?></dd>
45
+ <?unless klass.includes.empty? ?>
46
+ <dt>Included Modules</dt>
47
+ <?for inc in klass.includes ?>
48
+ <?if inc.module.respond_to?(:path) ?>
49
+ <dd class="include"><a href="[?call klass.aref_to(inc.module.path) ?]"><?call
50
+ inc.module.full_name ?></a></dd>
104
51
  <?else ?>
105
- <dd class="description missing-docs">(Not documented)</dd>
106
- <?end ?>
107
- <?end ?>
108
- </dl>
109
-
110
- </section>
111
- <?end ?>
52
+ <dd class="include"><?call inc.name ?></dd>
53
+ <?end if ?>
54
+ <?end for ?>
55
+ <?end unless ?>
112
56
 
113
- <?if attrs.any?{|a| a.display? } ?>
114
- <!-- Attributes -->
115
- <section class="attributes-list">
116
- <header>
117
- <h3>Attributes</h3>
118
- </header>
119
- <dl class="attributes">
120
- <?for attrib in attrs.select {|a| a.display? } ?>
121
- <dt id="[?call attrib.aref ?]"><i class="icon-generic"></i><?call attrib.name ?> <span
122
- class="attribute-access-type [?call attrib.rw.downcase ?]"><?call
123
- attrib.rw ?></span></dt>
124
- <?if attrib.comment ?>
125
- <dd class="description"><?call attrib.description.strip ?></dd>
57
+ <?unless klass.extends.empty? ?>
58
+ <dt>Extended With</dt>
59
+ <?for ext in klass.extends.uniq ?>
60
+ <?if ext.module.respond_to?(:path) ?>
61
+ <dd class="extend"><a href="[?call klass.aref_to(ext.module.path) ?]"><?call
62
+ ext.module.full_name ?></a></dd>
126
63
  <?else ?>
127
- <dd class="description missing-docs">(Not documented)</dd>
128
- <?end ?>
129
- <?end ?>
64
+ <dd class="extend"><?call ext.name ?></dd>
65
+ <?end if ?>
66
+ <?end for ?>
67
+ <?end unless ?>
130
68
  </dl>
131
69
  </section>
132
- <?end if ?>
70
+ </div>
71
+ </div>
133
72
 
134
- <!-- Methods -->
135
- <?for scope, visibilities in klass.methods_by_type( section ) ?>
136
- <?for visibility, methodlist in visibilities ?>
137
73
 
138
- <?unless methodlist.empty? ?>
139
- <section class="[?attr visibility ?]-methods [?attr scope ?]-methods methods">
74
+ <div class="row">
75
+ <div class="column">
76
+
77
+ <?for section, constants, attrs in klass.each_section ?>
78
+ <section id="<?call section.aref ?>" class="documentation-section">
79
+ <?if section.title ?>
140
80
  <header>
141
- <h3><?call visibility.to_s.capitalize ?> <?call scope.capitalize ?> Methods</h3>
81
+ <h2><?call section.title ?></h2>
82
+ <span class="section-click-top">
83
+ <a href="#top">&uarr; top</a>
84
+ </span>
142
85
  </header>
86
+ <?end if ?>
143
87
 
144
- <?for meth in methodlist ?>
145
- <a name="[?call meth.aref ?]"></a>
146
- <div id="<?call meth.aref ?>-doc" class="method[?if meth.is_alias_for
147
- ?] method-alias[?end if ?]">
88
+ <?if section.comment ?>
89
+ <section class="description">
90
+ <?call section.description ?>
91
+ </section>
92
+ <?end if ?>
148
93
 
94
+ <?if constants.any?{|c| c.display? } ?>
95
+ <!-- Constants -->
96
+ <section class="constants-list">
149
97
  <header>
150
- <?if meth.call_seq ?>
151
- <?for call_seq, i in meth.call_seq.strip.split("\n") ?>
152
- <i class="fas fa-chevron-right"></i>
153
- <span class="method-callseq"
154
- ><?call
155
- call_seq.strip.gsub( /^\w+\./m, '').gsub(/->/, '&rarr;')
156
- ?></span><br />
157
- <?end for ?>
158
- <?else ?>
159
- <i class="fas fa-chevron-right"></i>
160
- <span class="method-name"><?escape meth.name ?></span><span
161
- class="method-args"><?escape meth.param_seq ?></span>
162
- <?end if ?>
98
+ <h3>Constants</h3>
163
99
  </header>
100
+ <dl>
101
+ <?for const in constants.select {|c| c.display? } ?>
102
+ <dt id="[?call const.name ?]"><i class="icon-generic"></i><?call const.name ?></dt>
103
+ <?if const.comment ?>
104
+ <dd class="description"><?call const.description.strip ?></dd>
105
+ <?else ?>
106
+ <dd class="description missing-docs">(Not documented)</dd>
107
+ <?end ?>
108
+ <?end ?>
109
+ </dl>
110
+ </section>
111
+ <?end ?>
164
112
 
165
- <div class="method-description">
166
- <?if meth.comment ?>
167
- <?call meth.description.strip ?>
168
- <?else ?>
169
- <p class="missing-docs">(Not documented)</p>
113
+ <?if attrs.any?{|a| a.display? } ?>
114
+ <!-- Attributes -->
115
+ <section class="attributes-list">
116
+ <header>
117
+ <h3>Attributes</h3>
118
+ </header>
119
+ <dl>
120
+ <?for attrib in attrs.select {|a| a.display? } ?>
121
+ <dt id="[?call attrib.aref ?]"><i class="icon-generic"></i><?call attrib.name ?> <span
122
+ class="attribute-access-type [?call attrib.rw.downcase ?]"><?call
123
+ attrib.rw ?></span></dt>
124
+ <?if attrib.comment ?>
125
+ <dd class="description"><?call attrib.description.strip ?></dd>
126
+ <?else ?>
127
+ <dd class="description missing-docs">(Not documented)</dd>
128
+ <?end ?>
170
129
  <?end ?>
130
+ </dl>
131
+ </section>
132
+ <?end if ?>
171
133
 
172
- <?if meth.token_stream ?>
173
- <div class="method-source-code message" id="[?call meth.html_name ?]-source">
174
- <pre class="prettyprint linenums message-body"><code
175
- class="language-ruby"><?call meth.markup_code ?></code></pre>
134
+ <!-- Methods -->
135
+ <?for scope, visibilities in klass.methods_by_type( section ) ?>
136
+ <?for visibility, methodlist in visibilities ?>
137
+
138
+ <?unless methodlist.empty? ?>
139
+ <section class="[?attr visibility ?]-methods [?attr scope ?]-methods methods">
140
+ <header>
141
+ <h3><?call visibility.to_s.capitalize ?> <?call scope.capitalize ?> Methods</h3>
142
+ </header>
143
+
144
+ <?for meth in methodlist ?>
145
+ <a name="[?call meth.aref ?]">anchor</a>
146
+ <div id="<?call meth.aref ?>-doc" class="method[?if meth.is_alias_for
147
+ ?] method-alias[?end if ?]">
148
+
149
+ <header>
150
+ <?if meth.call_seq ?>
151
+ <?for call_seq, i in meth.call_seq.strip.split("\n") ?>
152
+ <i class="icon-generic"></i>
153
+ <span class="method-callseq"
154
+ ><?call
155
+ call_seq.strip.gsub( /^\w+\./m, '').gsub(/->/, '&rarr;')
156
+ ?></span><br />
157
+ <?end for ?>
158
+ <?else ?>
159
+ <i class="icon-generic"></i>
160
+ <span class="method-name"><?escape meth.name ?></span><span
161
+ class="method-args"><?escape meth.param_seq ?></span>
162
+ <?end if ?>
163
+ </header>
164
+
165
+ <div class="method-description">
166
+ <?if meth.comment ?>
167
+ <?call meth.description.strip ?>
168
+ <?else ?>
169
+ <p class="missing-docs">(Not documented)</p>
170
+ <?end ?>
171
+
172
+ <?if meth.token_stream ?>
173
+ <div class="method-source-code" id="[?call meth.html_name ?]-source">
174
+ <pre class="prettyprint linenums"><code
175
+ class="language-ruby"><?call meth.markup_code ?></code></pre>
176
+ </div>
177
+ <?end ?>
176
178
  </div>
177
- <?end ?>
178
- </div>
179
179
 
180
- <?unless meth.aliases.empty? ?>
181
- <div class="aliases">
182
- Also aliased as:
183
- <?for aka in meth.aliases ?>
184
- <?if aka.parent ?>
185
- <a href="[?call klass.aref_to(aka.path) ?]"><?escape aka.name ?></a>
186
- <?else ?>
187
- <?escape aka.name ?>
188
- <?end if ?><?unless aka == meth.aliases.last ?>, <?end unless ?>
189
- <?end for ?>
190
- </div>
191
- <?end ?>
180
+ <?unless meth.aliases.empty? ?>
181
+ <div class="aliases">
182
+ Also aliased as:
183
+ <?for aka in meth.aliases ?>
184
+ <?if aka.parent ?>
185
+ <a href="[?call klass.aref_to(aka.path) ?]"><?escape aka.name ?></a>
186
+ <?else ?>
187
+ <?escape aka.name ?>
188
+ <?end if ?><?unless aka == meth.aliases.last ?>, <?end unless ?>
189
+ <?end for ?>
190
+ </div>
191
+ <?end ?>
192
192
 
193
- <?if meth.is_alias_for ?>
194
- <div class="aliases">
195
- Alias for: <a href="[?call klass.aref_to( meth.is_alias_for.path )
196
- ?]"><?escape meth.is_alias_for.name ?></a>
193
+ <?if meth.is_alias_for ?>
194
+ <div class="aliases">
195
+ Alias for: <a href="[?call klass.aref_to( meth.is_alias_for.path )
196
+ ?]"><?escape meth.is_alias_for.name ?></a>
197
+ </div>
198
+ <?end if ?>
197
199
  </div>
198
- <?end if ?>
199
- </div>
200
+ <?end for ?>
201
+
202
+ </section>
203
+ <?end unless ?>
204
+
205
+ <?end for ?>
200
206
  <?end for ?>
201
207
 
202
208
  </section>
203
- <?end unless ?>
204
-
205
209
  <?end for ?>
206
- <?end for ?>
207
- </section>
208
210
 
209
- <?end for ?>
211
+ </div>
210
212
  </div>
211
-
@@ -1,8 +1,20 @@
1
1
  <?import rel_prefix, modsort, files ?>
2
2
 
3
- <header>
4
- <h1 class="title is-1"><?strip header ?></h1>
5
- </header>
3
+ <div class="row">
4
+ <div class="column">
6
5
 
7
- <?attr description ?>
6
+ <header class="hero-unit">
7
+ <?if header =~ /<h\d/ ?>
8
+ <?attr header ?>
9
+ <?else?>
10
+ <h1><?attr header ?></h1>
11
+ <?end if ?>
12
+ </header>
13
+
14
+ <section class="description">
15
+ <?attr description ?>
16
+ </section>
17
+
18
+ </div>
19
+ </div>
8
20
 
@@ -1,83 +1,54 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
-
6
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
-
8
- <title><?escape rdoc_options.title ?></title>
9
-
10
- <meta name="description" content="API documentation for [?escape rdoc_options.title ?]">
11
- <meta name="author" content="">
12
-
13
- <meta name="viewport" content="width=device-width, initial-scale=1">
14
-
15
- <link rel="icon" type="image/png" href="[?attr rel_prefix ?]/images/favicon.png">
16
- <link rel="prefix" href="[?attr rel_prefix ?]" />
17
-
18
- <link rel="stylesheet" href="[?attr rel_prefix ?]/css/sixfish.css">
19
- </head>
20
- <body>
21
-
22
- <main class="section">
23
-
24
- <div class="content container">
25
- <header>
26
- <h1 class="title is-1"><?escape rdoc_options.title ?></h1>
27
- </header>
28
-
29
- <?if synopsis ?>
30
- <?attr synopsis ?>
31
- <?else ?>
32
- <p>This is the API documentation for <?escape rdoc_options.title ?>.</p>
33
-
34
- <p>Starting points:</p>
35
- <?end if ?>
36
-
37
- <div class="columns is-gapless is-desktop">
38
-
39
- <div class="column">
40
- <header>
41
- <h2 class="title is-2">Files</h2>
42
- </header>
43
-
44
- <ul class="files">
45
- <?if mainpage ?>
46
- <li><a href="[?attr rel_prefix ?]/[?call mainpage.path ?]"><?escape
47
- mainpage.page_name ?></a></li>
48
- <?end if ?>
49
- <?for file in files.select {|f| f.text? }.sort ?>
50
- <li><a href="[?attr rel_prefix ?]/[?call file.path ?]"><?escape
51
- file.page_name ?></a></li>
52
- <?end for ?>
53
- </ul>
54
- </div>
55
-
56
-
57
- <div class="column">
58
- <header>
59
- <h2 class="title is-2">Classes/Modules</h2>
60
- </header>
61
-
62
- <ul class="classes">
63
- <?for index_class in modsort.select( &:documented? ).uniq {|c| c.path } ?>
64
- <li><a href="[?attr rel_prefix ?]/[?call index_class.path ?]"><?call
65
- index_class.full_name ?></a> </li>
66
- <?end for ?>
67
- </ul>
68
- </div>
1
+ <?import rel_prefix, modsort, methods, files ?>
2
+
3
+ <div class="row">
4
+ <div class="column">
5
+
6
+ <header>
7
+ <?attr synopsis ?>
8
+ <?if mainpage ?>
9
+ <p><a class="btn btn-primary btn-large"
10
+ href="[?call mainpage.path ?]">Learn more &raquo;</a></p>
11
+ <?end if ?>
12
+ </header>
13
+
14
+ <!-- Indexes -->
15
+ <section id="indexes" class="row">
16
+ <div class="span4">
17
+ <ul id="class-index" class="nav nav-list">
18
+ <li class="nav-header">Classes/Modules</li>
19
+ <?for index_class in modsort.select( &:documented? ).uniq {|c| c.path } ?>
20
+ <li><a href="[?attr rel_prefix ?]/[?call index_class.path ?]"
21
+ title="[?call index_class.full_name ?]"><?call
22
+ index_class.full_name.gsub(/(.+?)(?=::)/, '<span class="ns">\\1</span>') ?></a></li>
23
+ <?end for ?>
24
+ </ul>
25
+ </div>
69
26
 
70
- </div>
27
+ <div class="span4">
28
+ <ul id="method-index" class="nav nav-list">
29
+ <li class="nav-header">Methods</li>
30
+ <?for method in methods.uniq {|m| m.path } ?>
31
+ <li class="method"><a title="[?call method.parent.full_name ?]"
32
+ href="[?call method.path ?]"><?call method.pretty_name ?>
33
+ <span class="method-parent">[<?call
34
+ method.parent.full_name.sub(/.*(::)/, '\\1') ?>]</span>
35
+ </a>
36
+ </li>
37
+ <?end for ?>
38
+ </ul>
71
39
  </div>
72
40
 
73
- </main>
41
+ <div class="span4">
42
+ <ul id="file-index" class="nav nav-list">
43
+ <li class="nav-header">Files</li>
44
+ <?for file in files.select {|f| f.text? }.sort ?>
45
+ <li class="file"><a href="[?call file.path ?]"><?escape file.page_name ?></a></li>
46
+ <?end for ?>
47
+ </ul>
48
+ </div>
74
49
 
75
- <footer class="footer">
76
- <span id="rdoc-version">Generated by RDoc <?attr rdoc_version ?></span> using the
77
- <a id="generator-version"
78
- href="https://hg.sr.ht/~ged/Sixfish"><?attr sixfish_version ?></a> generator.
79
- </footer>
50
+ </section>
80
51
 
81
- </body>
82
- </html>
52
+ </div>
53
+ </div>
83
54