rdoc-generator-sixfish 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,211 @@
1
+ <?import rel_prefix, modsort, files ?>
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>
42
+ <?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>
83
+ </header>
84
+ <?end if ?>
85
+
86
+ <?if section.comment ?>
87
+ <p class="description">
88
+ <?call section.description ?>
89
+ </p>
90
+ <?end if ?>
91
+
92
+ <?if constants.any?{|c| c.display? } ?>
93
+ <!-- Constants -->
94
+ <section class="constants-list">
95
+ <header>
96
+ <h3>Constants</h3>
97
+ </header>
98
+
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>
104
+ <?else ?>
105
+ <dd class="description missing-docs">(Not documented)</dd>
106
+ <?end ?>
107
+ <?end ?>
108
+ </dl>
109
+
110
+ </section>
111
+ <?end ?>
112
+
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>
126
+ <?else ?>
127
+ <dd class="description missing-docs">(Not documented)</dd>
128
+ <?end ?>
129
+ <?end ?>
130
+ </dl>
131
+ </section>
132
+ <?end if ?>
133
+
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 ?]"></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="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 ?>
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 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>
176
+ </div>
177
+ <?end ?>
178
+ </div>
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 ?>
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>
197
+ </div>
198
+ <?end if ?>
199
+ </div>
200
+ <?end for ?>
201
+
202
+ </section>
203
+ <?end unless ?>
204
+
205
+ <?end for ?>
206
+ <?end for ?>
207
+ </section>
208
+
209
+ <?end for ?>
210
+ </div>
211
+
@@ -0,0 +1,8 @@
1
+ <?import rel_prefix, modsort, files ?>
2
+
3
+ <header>
4
+ <h1 class="title is-1"><?strip header ?></h1>
5
+ </header>
6
+
7
+ <?attr description ?>
8
+
@@ -0,0 +1,83 @@
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>
69
+
70
+ </div>
71
+ </div>
72
+
73
+ </main>
74
+
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>
80
+
81
+ </body>
82
+ </html>
83
+
@@ -0,0 +1,97 @@
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
+
20
+ <script src="[?attr rel_prefix ?]/js/sixfish.js"></script>
21
+ </head>
22
+ <body>
23
+
24
+ <main class="columns section">
25
+
26
+ <nav class="index column is-one-quarter">
27
+
28
+ <div class="field">
29
+ <p class="control has-icons-left">
30
+ <input id="index-search" class="input is-rounded" type="text" placeholder="Search">
31
+ <span class="icon is-small is-left">
32
+ <i class="fas fa-solid fa-search"></i>
33
+ </span>
34
+ </p>
35
+ </div>
36
+
37
+ <aside class="menu">
38
+ <p class="menu-label">Files</p>
39
+
40
+ <ul id="file-index" class="menu-list">
41
+ <?if mainpage ?>
42
+ <li class="file" data-search-term="[?attr mainpage.page_name ?]"><a
43
+ href="[?attr rel_prefix ?]/[?call mainpage.path ?]"><?escape mainpage.page_name ?></a></li>
44
+ <?end if ?>
45
+ <?for file in files.select {|f| f.text? }.sort ?>
46
+ <li class="file" data-search-term="[?attr file.page_name ?]"><a
47
+ href="[?attr rel_prefix ?]/[?call file.path ?]"><?escape file.page_name ?></a></li>
48
+ <?end for ?>
49
+ </ul>
50
+ </aside>
51
+
52
+ <aside class="menu">
53
+ <p class="menu-label">Classes/Modules</p>
54
+
55
+ <ul id="class-index" class="menu-list">
56
+ <?for index_class in modsort.select( &:documented? ).uniq {|c| c.path } ?>
57
+ <li class="class" data-search-term="[?attr index_class.full_name ?]"><a
58
+ href="[?attr rel_prefix ?]/[?call index_class.path ?]"><?call
59
+ index_class.full_name ?></a></li>
60
+ <?end for ?>
61
+ </ul>
62
+ </aside>
63
+
64
+ <aside class="menu">
65
+ <p class="menu-label">Methods</p>
66
+
67
+ <ul id="method-index" class="menu-list">
68
+ <?for method in methods.uniq {|m| m.path } ?>
69
+ <li class="method" data-search-term="[?attr method.name ?]"><a
70
+ title="[?call method.parent.full_name ?]"
71
+ href="[?call method.path ?]"><?call method.pretty_name ?>
72
+ <span class="method-parent">[<?call
73
+ method.parent.full_name.sub(/.*(::)/, '\\1') ?>]</span>
74
+ </a>
75
+ </li>
76
+ <?end for ?>
77
+ </ul>
78
+ </aside>
79
+ </nav>
80
+
81
+ <article class="description column">
82
+ <div class="content container">
83
+ <?attr contents ?>
84
+ </div>
85
+ </article>
86
+
87
+ </main>
88
+
89
+ <footer class="footer">
90
+ <span id="rdoc-version">Generated by RDoc <?attr rdoc_version ?></span> using the
91
+ <a id="generator-version"
92
+ href="https://hg.sr.ht/~ged/Sixfish"><?attr sixfish_version ?></a> generator.
93
+ </footer>
94
+
95
+ </body>
96
+ </html>
97
+
@@ -0,0 +1,42 @@
1
+ # -*- ruby -*-
2
+ # frozen_string_literal: true
3
+ # vim: set noet nosta sw=4 ts=4 :
4
+
5
+ require 'uri'
6
+ require 'inversion/template' unless defined?( Inversion::Template )
7
+ require 'inversion/template/attrtag'
8
+
9
+ # Inversion strip tag.
10
+ #
11
+ # This tag strips markup from a template attribute.
12
+ #
13
+ # == Syntax
14
+ #
15
+ # <?strip foo.bar ?>
16
+ #
17
+ class Inversion::Template::StripTag < Inversion::Template::AttrTag
18
+ include Inversion::Escaping
19
+
20
+
21
+ HTML_TAG = %r{
22
+ <
23
+ /?
24
+ \p{Alnum}+
25
+ (
26
+ \s+
27
+ \S+="[^\"]*"
28
+ )*
29
+ \s*
30
+ >
31
+ }xi
32
+
33
+
34
+ ### Render the method chains against the attributes of the specified +render_state+
35
+ ### and return them.
36
+ def render( render_state )
37
+ raw = super or return nil
38
+ return raw.gsub(HTML_TAG, '')
39
+ end
40
+
41
+ end # class Inversion::Template::StripTag
42
+
@@ -0,0 +1,7 @@
1
+ # -*- ruby -*-
2
+
3
+ $stderr.puts "Discovered Sixfish!" if $DEBUG
4
+
5
+ # RDoc plugin hook
6
+ require 'sixfish'
7
+