yard-api-slatelike 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +3 -3
- data/lib/yard-api-slatelike.rb +3 -2
- data/lib/yard-api-slatelike/options.rb +0 -0
- data/lib/yard-api-slatelike/version.rb +1 -1
- data/templates/api/fulldoc/html/css/monokai.css +128 -0
- data/templates/api/fulldoc/html/css/slatelike.css +212 -0
- data/templates/api/fulldoc/html/css/vroom.css +144 -0
- data/templates/api/fulldoc/html/js/scrollspy.js +59 -0
- data/templates/api/fulldoc/html/js/slatelike.js +120 -0
- data/templates/api/fulldoc/html/js/slatelike/nav.js +60 -0
- data/templates/api/fulldoc/html/js/slatelike/nav_scrollspy.js +13 -0
- data/templates/api/layout/html/_styles.erb +3 -0
- data/templates/api/layout/html/setup.rb +5 -1
- data/yard-api-slatelike.gemspec +5 -5
- metadata +33 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 40db238464163c14c3557192cde66ed7e097fc35a9bb658575e7706aa9960a1f
|
4
|
+
data.tar.gz: 73adaebc355f737f83201ed60d5de8f624150c5b53ca09eb1465b0356bc80f6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dd987e1a3e36f1941b9043f011706c5e02e1b5bd9f306df251d0efa178a960d0ded65edac1f58765f0c1962dd7d9c44a3b3948c867d5a4b23eb584353fcdf75
|
7
|
+
data.tar.gz: afd72fcd90ef510197f6b9167287d3a04bf1371a3d0681333ca2809a62026bcf2426bb3e310257e6173e067156cec769750769e746aaab69869208c5de1bad7c
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Nothing special except that you have to include the gem in your Gemfile (if usin
|
|
13
13
|
|
14
14
|
group :doc do
|
15
15
|
gem 'yard-api'
|
16
|
-
gem 'yard-api-slatelike'
|
16
|
+
gem 'yard-api-slatelike'
|
17
17
|
end
|
18
18
|
```
|
19
19
|
|
@@ -37,8 +37,8 @@ end
|
|
37
37
|
|
38
38
|
The plugin comes with two themes out of the box, one that is a mimic of Slate's, and another which follows the same layout but with different colors and a few readability (opinionated) enhancements.
|
39
39
|
|
40
|
-
|
41
|
-
|
40
|
+
1. `slate` (default)
|
41
|
+
2. `vroom` (recommended)
|
42
42
|
|
43
43
|
You can specify the theme in your `yard_api.yml` file under the `theme` parameter.
|
44
44
|
|
data/lib/yard-api-slatelike.rb
CHANGED
@@ -27,9 +27,10 @@ module YARD
|
|
27
27
|
TEMPLATE_PATH = File.join(%W[#{ROOT} .. templates])
|
28
28
|
end
|
29
29
|
|
30
|
-
require 'yard-api-slatelike/version'
|
31
|
-
|
32
30
|
module Templates
|
33
31
|
Engine.register_template_path YARD::APISlateLikePlugin::TEMPLATE_PATH
|
34
32
|
end
|
33
|
+
|
34
|
+
require 'yard-api-slatelike/version'
|
35
|
+
require 'yard-api-slatelike/options'
|
35
36
|
end
|
File without changes
|
@@ -0,0 +1,128 @@
|
|
1
|
+
|
2
|
+
/*
|
3
|
+
Monokai style - ported by Luigi Maselli - http://grigio.org
|
4
|
+
*/
|
5
|
+
|
6
|
+
.hljs {
|
7
|
+
display: block;
|
8
|
+
overflow-x: auto;
|
9
|
+
padding: 0.5em;
|
10
|
+
background: #272822;
|
11
|
+
-webkit-text-size-adjust: none;
|
12
|
+
}
|
13
|
+
|
14
|
+
.hljs-tag,
|
15
|
+
.hljs-tag .hljs-title,
|
16
|
+
.hljs-keyword,
|
17
|
+
.hljs-literal,
|
18
|
+
.hljs-strong,
|
19
|
+
.hljs-change,
|
20
|
+
.hljs-winutils,
|
21
|
+
.hljs-flow,
|
22
|
+
.nginx .hljs-title,
|
23
|
+
.tex .hljs-special {
|
24
|
+
color: #f92672;
|
25
|
+
}
|
26
|
+
|
27
|
+
.hljs {
|
28
|
+
color: #ddd;
|
29
|
+
}
|
30
|
+
|
31
|
+
.hljs .hljs-constant,
|
32
|
+
.asciidoc .hljs-code {
|
33
|
+
color: #66d9ef;
|
34
|
+
}
|
35
|
+
|
36
|
+
.hljs-code,
|
37
|
+
.hljs-class .hljs-title,
|
38
|
+
.hljs-header {
|
39
|
+
color: white;
|
40
|
+
}
|
41
|
+
|
42
|
+
.hljs-link_label,
|
43
|
+
.hljs-attribute,
|
44
|
+
.hljs-symbol,
|
45
|
+
.hljs-symbol .hljs-string,
|
46
|
+
.hljs-value,
|
47
|
+
.hljs-regexp {
|
48
|
+
color: #bf79db;
|
49
|
+
}
|
50
|
+
|
51
|
+
.hljs-link_url,
|
52
|
+
.hljs-tag .hljs-value,
|
53
|
+
.hljs-string,
|
54
|
+
.hljs-bullet,
|
55
|
+
.hljs-subst,
|
56
|
+
.hljs-title,
|
57
|
+
.hljs-emphasis,
|
58
|
+
.hljs-type,
|
59
|
+
.hljs-preprocessor,
|
60
|
+
.hljs-pragma,
|
61
|
+
.ruby .hljs-class .hljs-parent,
|
62
|
+
.hljs-built_in,
|
63
|
+
.django .hljs-template_tag,
|
64
|
+
.django .hljs-variable,
|
65
|
+
.smalltalk .hljs-class,
|
66
|
+
.hljs-javadoc,
|
67
|
+
.django .hljs-filter .hljs-argument,
|
68
|
+
.smalltalk .hljs-localvars,
|
69
|
+
.smalltalk .hljs-array,
|
70
|
+
.hljs-attr_selector,
|
71
|
+
.hljs-pseudo,
|
72
|
+
.hljs-addition,
|
73
|
+
.hljs-stream,
|
74
|
+
.hljs-envvar,
|
75
|
+
.apache .hljs-tag,
|
76
|
+
.apache .hljs-cbracket,
|
77
|
+
.tex .hljs-command,
|
78
|
+
.hljs-prompt {
|
79
|
+
color: #a6e22e;
|
80
|
+
}
|
81
|
+
|
82
|
+
.hljs-comment,
|
83
|
+
.hljs-annotation,
|
84
|
+
.smartquote,
|
85
|
+
.hljs-blockquote,
|
86
|
+
.hljs-horizontal_rule,
|
87
|
+
.hljs-decorator,
|
88
|
+
.hljs-template_comment,
|
89
|
+
.hljs-pi,
|
90
|
+
.hljs-doctype,
|
91
|
+
.hljs-deletion,
|
92
|
+
.hljs-shebang,
|
93
|
+
.apache .hljs-sqbracket,
|
94
|
+
.tex .hljs-formula {
|
95
|
+
color: #75715e;
|
96
|
+
}
|
97
|
+
|
98
|
+
.hljs-keyword,
|
99
|
+
.hljs-literal,
|
100
|
+
.css .hljs-id,
|
101
|
+
.hljs-phpdoc,
|
102
|
+
.hljs-dartdoc,
|
103
|
+
.hljs-title,
|
104
|
+
.hljs-header,
|
105
|
+
.hljs-type,
|
106
|
+
.vbscript .hljs-built_in,
|
107
|
+
.rsl .hljs-built_in,
|
108
|
+
.smalltalk .hljs-class,
|
109
|
+
.diff .hljs-header,
|
110
|
+
.hljs-chunk,
|
111
|
+
.hljs-winutils,
|
112
|
+
.bash .hljs-variable,
|
113
|
+
.apache .hljs-tag,
|
114
|
+
.tex .hljs-special,
|
115
|
+
.hljs-request,
|
116
|
+
.hljs-status {
|
117
|
+
font-weight: bold;
|
118
|
+
}
|
119
|
+
|
120
|
+
.coffeescript .javascript,
|
121
|
+
.javascript .xml,
|
122
|
+
.tex .hljs-formula,
|
123
|
+
.xml .javascript,
|
124
|
+
.xml .vbscript,
|
125
|
+
.xml .css,
|
126
|
+
.xml .hljs-cdata {
|
127
|
+
opacity: 0.5;
|
128
|
+
}
|
@@ -0,0 +1,212 @@
|
|
1
|
+
#content h1 {
|
2
|
+
font-size: 30px;
|
3
|
+
padding-top: 0.5em;
|
4
|
+
padding-bottom: 0.5em;
|
5
|
+
border: 1px solid #ddd;
|
6
|
+
border-bottom: 1px solid #ccc;
|
7
|
+
margin-bottom: 21px;
|
8
|
+
margin-top: 2em;
|
9
|
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fff), color-stop(100%, #f9f9f9));
|
10
|
+
background-image: -webkit-linear-gradient(top, #fff, #f9f9f9);
|
11
|
+
background-image: -moz-linear-gradient(top, #fff, #f9f9f9);
|
12
|
+
background-image: -o-linear-gradient(top, #fff, #f9f9f9);
|
13
|
+
background-image: linear-gradient(top, #ffffff,#f9f9f9);
|
14
|
+
}
|
15
|
+
|
16
|
+
#sidebar .subnav {
|
17
|
+
margin: 0;
|
18
|
+
padding: 0;
|
19
|
+
list-style: none;
|
20
|
+
}
|
21
|
+
|
22
|
+
#sidebar a, #sidebar a:visited {
|
23
|
+
color: inherit;
|
24
|
+
}
|
25
|
+
|
26
|
+
#sidebar a:hover {
|
27
|
+
color: #aaa;
|
28
|
+
}
|
29
|
+
|
30
|
+
body {
|
31
|
+
background-color: #eaf2f6;
|
32
|
+
}
|
33
|
+
|
34
|
+
#sidebar {
|
35
|
+
background-color: #393939;
|
36
|
+
color: white;
|
37
|
+
padding: 0;
|
38
|
+
position: fixed;
|
39
|
+
left: 0;
|
40
|
+
width: 240px;
|
41
|
+
text-align: left;
|
42
|
+
}
|
43
|
+
|
44
|
+
#sidebar h1 {
|
45
|
+
margin: 0;
|
46
|
+
padding: 0;
|
47
|
+
background: #2a2a2a;
|
48
|
+
}
|
49
|
+
|
50
|
+
#sidebar h1 a {
|
51
|
+
padding: 20px;
|
52
|
+
}
|
53
|
+
|
54
|
+
#sidebar a {
|
55
|
+
padding-left: 20px;
|
56
|
+
padding-right: 20px;
|
57
|
+
}
|
58
|
+
|
59
|
+
#sidebar nav {
|
60
|
+
margin: 20px 0;
|
61
|
+
}
|
62
|
+
|
63
|
+
#sidebar .subnav {
|
64
|
+
padding-left: 20px;
|
65
|
+
background: #2a2a2a;
|
66
|
+
margin-left: -20px;
|
67
|
+
width: 260px;
|
68
|
+
text-shadow: 0 1px 0 rgba(0,0,0,0.75);
|
69
|
+
}
|
70
|
+
|
71
|
+
#sidebar .subnav a {
|
72
|
+
font-weight: normal;
|
73
|
+
}
|
74
|
+
|
75
|
+
#sidebar a.active {
|
76
|
+
background: #2467af;
|
77
|
+
color: white;
|
78
|
+
}
|
79
|
+
|
80
|
+
#sidebar .subnav a.active {
|
81
|
+
background: none;
|
82
|
+
color: green;
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
/*
|
87
|
+
Monokai style - ported by Luigi Maselli - http://grigio.org
|
88
|
+
*/
|
89
|
+
|
90
|
+
.hljs {
|
91
|
+
display: block;
|
92
|
+
overflow-x: auto;
|
93
|
+
padding: 0.5em;
|
94
|
+
background: #272822;
|
95
|
+
-webkit-text-size-adjust: none;
|
96
|
+
}
|
97
|
+
|
98
|
+
.hljs-tag,
|
99
|
+
.hljs-tag .hljs-title,
|
100
|
+
.hljs-keyword,
|
101
|
+
.hljs-literal,
|
102
|
+
.hljs-strong,
|
103
|
+
.hljs-change,
|
104
|
+
.hljs-winutils,
|
105
|
+
.hljs-flow,
|
106
|
+
.nginx .hljs-title,
|
107
|
+
.tex .hljs-special {
|
108
|
+
color: #f92672;
|
109
|
+
}
|
110
|
+
|
111
|
+
.hljs {
|
112
|
+
color: #ddd;
|
113
|
+
}
|
114
|
+
|
115
|
+
.hljs .hljs-constant,
|
116
|
+
.asciidoc .hljs-code {
|
117
|
+
color: #66d9ef;
|
118
|
+
}
|
119
|
+
|
120
|
+
.hljs-code,
|
121
|
+
.hljs-class .hljs-title,
|
122
|
+
.hljs-header {
|
123
|
+
color: white;
|
124
|
+
}
|
125
|
+
|
126
|
+
.hljs-link_label,
|
127
|
+
.hljs-attribute,
|
128
|
+
.hljs-symbol,
|
129
|
+
.hljs-symbol .hljs-string,
|
130
|
+
.hljs-value,
|
131
|
+
.hljs-regexp {
|
132
|
+
color: #bf79db;
|
133
|
+
}
|
134
|
+
|
135
|
+
.hljs-link_url,
|
136
|
+
.hljs-tag .hljs-value,
|
137
|
+
.hljs-string,
|
138
|
+
.hljs-bullet,
|
139
|
+
.hljs-subst,
|
140
|
+
.hljs-title,
|
141
|
+
.hljs-emphasis,
|
142
|
+
.hljs-type,
|
143
|
+
.hljs-preprocessor,
|
144
|
+
.hljs-pragma,
|
145
|
+
.ruby .hljs-class .hljs-parent,
|
146
|
+
.hljs-built_in,
|
147
|
+
.django .hljs-template_tag,
|
148
|
+
.django .hljs-variable,
|
149
|
+
.smalltalk .hljs-class,
|
150
|
+
.hljs-javadoc,
|
151
|
+
.django .hljs-filter .hljs-argument,
|
152
|
+
.smalltalk .hljs-localvars,
|
153
|
+
.smalltalk .hljs-array,
|
154
|
+
.hljs-attr_selector,
|
155
|
+
.hljs-pseudo,
|
156
|
+
.hljs-addition,
|
157
|
+
.hljs-stream,
|
158
|
+
.hljs-envvar,
|
159
|
+
.apache .hljs-tag,
|
160
|
+
.apache .hljs-cbracket,
|
161
|
+
.tex .hljs-command,
|
162
|
+
.hljs-prompt {
|
163
|
+
color: #a6e22e;
|
164
|
+
}
|
165
|
+
|
166
|
+
.hljs-comment,
|
167
|
+
.hljs-annotation,
|
168
|
+
.smartquote,
|
169
|
+
.hljs-blockquote,
|
170
|
+
.hljs-horizontal_rule,
|
171
|
+
.hljs-decorator,
|
172
|
+
.hljs-template_comment,
|
173
|
+
.hljs-pi,
|
174
|
+
.hljs-doctype,
|
175
|
+
.hljs-deletion,
|
176
|
+
.hljs-shebang,
|
177
|
+
.apache .hljs-sqbracket,
|
178
|
+
.tex .hljs-formula {
|
179
|
+
color: #75715e;
|
180
|
+
}
|
181
|
+
|
182
|
+
.hljs-keyword,
|
183
|
+
.hljs-literal,
|
184
|
+
.css .hljs-id,
|
185
|
+
.hljs-phpdoc,
|
186
|
+
.hljs-dartdoc,
|
187
|
+
.hljs-title,
|
188
|
+
.hljs-header,
|
189
|
+
.hljs-type,
|
190
|
+
.vbscript .hljs-built_in,
|
191
|
+
.rsl .hljs-built_in,
|
192
|
+
.smalltalk .hljs-class,
|
193
|
+
.diff .hljs-header,
|
194
|
+
.hljs-chunk,
|
195
|
+
.hljs-winutils,
|
196
|
+
.bash .hljs-variable,
|
197
|
+
.apache .hljs-tag,
|
198
|
+
.tex .hljs-special,
|
199
|
+
.hljs-request,
|
200
|
+
.hljs-status {
|
201
|
+
font-weight: bold;
|
202
|
+
}
|
203
|
+
|
204
|
+
.coffeescript .javascript,
|
205
|
+
.javascript .xml,
|
206
|
+
.tex .hljs-formula,
|
207
|
+
.xml .javascript,
|
208
|
+
.xml .vbscript,
|
209
|
+
.xml .css,
|
210
|
+
.xml .hljs-cdata {
|
211
|
+
opacity: 0.5;
|
212
|
+
}
|
@@ -0,0 +1,144 @@
|
|
1
|
+
body {
|
2
|
+
font: 16px/1.6 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
3
|
+
}
|
4
|
+
|
5
|
+
#content h1 {
|
6
|
+
}
|
7
|
+
|
8
|
+
#sidebar a, #sidebar a:visited {
|
9
|
+
color: inherit;
|
10
|
+
}
|
11
|
+
|
12
|
+
#sidebar a:hover {
|
13
|
+
color: #888;
|
14
|
+
}
|
15
|
+
|
16
|
+
#sidebar {
|
17
|
+
background-color: #f4f4f4;
|
18
|
+
padding: 0;
|
19
|
+
text-align: left;
|
20
|
+
border-right-color: #ddd;
|
21
|
+
}
|
22
|
+
|
23
|
+
#sidebar h1 {
|
24
|
+
margin-right: 20px;
|
25
|
+
}
|
26
|
+
.onefile #sidebar h1 {
|
27
|
+
margin: 0;
|
28
|
+
padding: 0;
|
29
|
+
background: #eee;
|
30
|
+
border-bottom-color: #ddd;
|
31
|
+
}
|
32
|
+
|
33
|
+
#sidebar h1 a {
|
34
|
+
padding: 20px;
|
35
|
+
font-size: inherit;
|
36
|
+
}
|
37
|
+
|
38
|
+
#sidebar h2 {
|
39
|
+
padding: 0 20px;
|
40
|
+
color: #777;
|
41
|
+
}
|
42
|
+
|
43
|
+
#sidebar h2:first-of-type {
|
44
|
+
margin-top: 20px;
|
45
|
+
}
|
46
|
+
|
47
|
+
#sidebar a {
|
48
|
+
padding-left: 20px;
|
49
|
+
padding-right: 20px;
|
50
|
+
}
|
51
|
+
|
52
|
+
#sidebar nav {
|
53
|
+
margin: 20px 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
#sidebar .subnav {
|
57
|
+
margin: 0;
|
58
|
+
padding: 0;
|
59
|
+
list-style: none;
|
60
|
+
padding-left: 40px;
|
61
|
+
margin-left: -20px;
|
62
|
+
}
|
63
|
+
|
64
|
+
#sidebar .subnav a {
|
65
|
+
font-weight: normal;
|
66
|
+
}
|
67
|
+
|
68
|
+
#sidebar a.active {
|
69
|
+
background: #3498db;
|
70
|
+
color: white;
|
71
|
+
}
|
72
|
+
|
73
|
+
#sidebar .subnav a.active {
|
74
|
+
background: none;
|
75
|
+
color: inherit;
|
76
|
+
font-weight: bold;
|
77
|
+
}
|
78
|
+
|
79
|
+
#sidebar .subnav a.active:before {
|
80
|
+
display: inline-block;
|
81
|
+
content: '';
|
82
|
+
position: absolute;
|
83
|
+
margin-left: -12px;
|
84
|
+
margin-top: 4px;
|
85
|
+
width: 0;
|
86
|
+
height: 0;
|
87
|
+
border-style: solid;
|
88
|
+
border-width: 5px 0 5px 8.7px;
|
89
|
+
border-color: transparent transparent transparent #3498db;
|
90
|
+
}
|
91
|
+
|
92
|
+
code {
|
93
|
+
border: none;
|
94
|
+
padding: 0;
|
95
|
+
}
|
96
|
+
|
97
|
+
#sidebar a.active.api_resource_link:after {
|
98
|
+
color: #ccc;
|
99
|
+
}
|
100
|
+
|
101
|
+
#sidebar .api_resource_link:after {
|
102
|
+
content: "API";
|
103
|
+
color: #888;
|
104
|
+
font-weight: bold;
|
105
|
+
margin-left: 5px;
|
106
|
+
}
|
107
|
+
|
108
|
+
.hljs, .method_details h3.endpoint {
|
109
|
+
background-color: #f4f4f4;
|
110
|
+
}
|
111
|
+
|
112
|
+
pre.code, div.syntaxhighlighter {
|
113
|
+
/*background-color: inherit;*/
|
114
|
+
border: none;
|
115
|
+
font-size: inherit;
|
116
|
+
line-height: inherit;
|
117
|
+
overflow: auto;
|
118
|
+
/*padding: inherit;*/
|
119
|
+
border-radius: 0;
|
120
|
+
font-family: monospace, Monaco, Consolas, Courier;
|
121
|
+
}
|
122
|
+
|
123
|
+
table {
|
124
|
+
border-collapse: collapse;
|
125
|
+
border-spacing: 0;
|
126
|
+
width: 100%;
|
127
|
+
}
|
128
|
+
|
129
|
+
th {
|
130
|
+
text-align: left;
|
131
|
+
background: #f4f4f4;
|
132
|
+
font-weight: bold;
|
133
|
+
}
|
134
|
+
|
135
|
+
td, th {
|
136
|
+
border: 1px solid #ddd;
|
137
|
+
padding: 6px 13px;
|
138
|
+
vertical-align: top;
|
139
|
+
}
|
140
|
+
|
141
|
+
td ul.argument-values {
|
142
|
+
margin: 0;
|
143
|
+
padding: 0 0 0 15px;
|
144
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
(function($) {
|
2
|
+
var $window = $(window);
|
3
|
+
var guid = 0;
|
4
|
+
var defaults = { defer: undefined };
|
5
|
+
|
6
|
+
$.fn.scrollSpy = function(options) {
|
7
|
+
if (!options) {
|
8
|
+
options = defaults;
|
9
|
+
}
|
10
|
+
|
11
|
+
var lastId;
|
12
|
+
var focalNodes = $(this).toArray().map(function(node) {
|
13
|
+
var $node = $(node);
|
14
|
+
|
15
|
+
return {
|
16
|
+
id: node.id,
|
17
|
+
$node: $node,
|
18
|
+
top: parseInt($node.offset().top, 10) + ($node.outerHeight()/2)
|
19
|
+
};
|
20
|
+
}).sort(function(a,b) {
|
21
|
+
return a.top - b.top;
|
22
|
+
});
|
23
|
+
|
24
|
+
var trigger = function(nodeEntry) {
|
25
|
+
nodeEntry.$node.triggerHandler('scrollSpy', [ nodeEntry.id, lastId ]);
|
26
|
+
};
|
27
|
+
|
28
|
+
$window.on('scroll.scrollSpy_' + (++guid), function() {
|
29
|
+
var scrollTop = $window.scrollTop();
|
30
|
+
var nodeEntry, i;
|
31
|
+
|
32
|
+
for (i = 0; i < focalNodes.length; ++i) {
|
33
|
+
if (focalNodes[i].top > scrollTop) {
|
34
|
+
if (focalNodes[i].top - scrollTop < $window.outerHeight()) {
|
35
|
+
nodeEntry = focalNodes[i];
|
36
|
+
break;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
if (nodeEntry && lastId !== nodeEntry.id) {
|
42
|
+
if (options.defer !== undefined) {
|
43
|
+
setTimeout(trigger.bind(null, nodeEntry), options.defer);
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
trigger(nodeEntry);
|
47
|
+
}
|
48
|
+
|
49
|
+
lastId = nodeEntry.id;
|
50
|
+
}
|
51
|
+
});
|
52
|
+
|
53
|
+
return {
|
54
|
+
reset: function() {
|
55
|
+
lastId = null;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
};
|
59
|
+
}(jQuery));
|
@@ -0,0 +1,120 @@
|
|
1
|
+
$(function() {
|
2
|
+
// =========================================================================
|
3
|
+
// Sidebar navigation
|
4
|
+
// =========================================================================
|
5
|
+
(function linkifyHeaders() {
|
6
|
+
var $staticPages = $('#static_pages');
|
7
|
+
|
8
|
+
var guid = 1;
|
9
|
+
var sanitizeText = function(text) {
|
10
|
+
return text
|
11
|
+
.replace(/\sAPI$/, '')
|
12
|
+
.toLowerCase()
|
13
|
+
.replace(/\s+/g, ' ')
|
14
|
+
.replace(/\W+/g, '-')
|
15
|
+
.trim();
|
16
|
+
};
|
17
|
+
|
18
|
+
// Make sure all headings have an id so we can anchor to them
|
19
|
+
$('#content').find('h1:not([id]), h2:not([id])').each(function() {
|
20
|
+
this.id = [ sanitizeText(this.innerText) ].join('_');
|
21
|
+
});
|
22
|
+
|
23
|
+
var mainHeaders = $('#content h1[id]').toArray().map(function(h1) {
|
24
|
+
var $h1 = $(h1);
|
25
|
+
var text;
|
26
|
+
var subSections;
|
27
|
+
|
28
|
+
if ($h1.next().is('article')) {
|
29
|
+
subSections = $h1.nextAll('.method_details_list').find('h2');
|
30
|
+
} else {
|
31
|
+
subSections = $h1.nextAll('h2');
|
32
|
+
}
|
33
|
+
|
34
|
+
return {
|
35
|
+
id: h1.id,
|
36
|
+
comparator: sanitizeText(h1.innerText),
|
37
|
+
children: subSections.toArray()
|
38
|
+
};
|
39
|
+
});
|
40
|
+
|
41
|
+
mainHeaders.forEach(function(header) {
|
42
|
+
var $subLinks;
|
43
|
+
var sidebarLink = $staticPages.find('a').filter(function() {
|
44
|
+
return sanitizeText(this.innerText) === header.comparator;
|
45
|
+
})[0];
|
46
|
+
|
47
|
+
if (!sidebarLink) {
|
48
|
+
console.warn('Unable to find sidebar entry for header %s', header.comparator);
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
|
52
|
+
$subLinks = $('<ul />', { class: 'subnav' });
|
53
|
+
|
54
|
+
header.children.forEach(function(el) {
|
55
|
+
var $el = $(el);
|
56
|
+
var text;
|
57
|
+
if ($el.find('a').length) {
|
58
|
+
text = $el.find('a:first')[0].innerText;
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
text = $el[0].innerText;
|
62
|
+
}
|
63
|
+
|
64
|
+
var $anchor = $('<a />', {
|
65
|
+
href: '#' + $el.attr('id')
|
66
|
+
}).text(text);
|
67
|
+
|
68
|
+
$('<li />').append($anchor).appendTo($subLinks);
|
69
|
+
});
|
70
|
+
|
71
|
+
$(sidebarLink).after($subLinks.hide());
|
72
|
+
|
73
|
+
// finally, change the original anchor that points to the article file
|
74
|
+
// to point to the bookmark in the current page
|
75
|
+
sidebarLink.href = '#' + header.id;
|
76
|
+
});
|
77
|
+
}());
|
78
|
+
|
79
|
+
// =========================================================================
|
80
|
+
// Scroll spying
|
81
|
+
// =========================================================================
|
82
|
+
(function installScrollSpy() {
|
83
|
+
var $staticPages = $('#static_pages');
|
84
|
+
var findLink = function(header) {
|
85
|
+
return $staticPages.find('a[href="#' + header.id + '"]');
|
86
|
+
};
|
87
|
+
var findSubnav = function(header) {
|
88
|
+
return findLink(header).next('.subnav');
|
89
|
+
};
|
90
|
+
|
91
|
+
var highlightSection = function($subnav) {
|
92
|
+
$staticPages.find('> a.active').removeClass('active');
|
93
|
+
$staticPages.find('.subnav:visible').hide();
|
94
|
+
$subnav.show().prev('a').addClass('active');
|
95
|
+
};
|
96
|
+
|
97
|
+
var highlightSubsection = function($link) {
|
98
|
+
$staticPages.find('.subnav a.active').removeClass('active');
|
99
|
+
$link.addClass('active');
|
100
|
+
highlightSection($link.closest('.subnav'));
|
101
|
+
};
|
102
|
+
|
103
|
+
var updateLocation = function(href) {
|
104
|
+
history.pushState(null, null, '#'+href);
|
105
|
+
};
|
106
|
+
|
107
|
+
$('#content h1').on('scrollSpy', function() {
|
108
|
+
highlightSection(findSubnav(this));
|
109
|
+
updateLocation(this.id);
|
110
|
+
});
|
111
|
+
|
112
|
+
$('#content h2').on('scrollSpy', function() {
|
113
|
+
highlightSubsection(findLink(this));
|
114
|
+
updateLocation(this.id);
|
115
|
+
});
|
116
|
+
|
117
|
+
$('#content h1').scrollSpy();
|
118
|
+
$('#content h2').scrollSpy({ defer: 0 });
|
119
|
+
}(this));
|
120
|
+
});
|
@@ -0,0 +1,60 @@
|
|
1
|
+
$(function() {
|
2
|
+
var scrollSpySelector = $('h1');
|
3
|
+
var $sidebar = $('#sidebar');
|
4
|
+
var $staticPages = $sidebar.find('#static_pages');
|
5
|
+
|
6
|
+
var guid = 1;
|
7
|
+
var sanitizeText = function(text) {
|
8
|
+
return text
|
9
|
+
.toLowerCase()
|
10
|
+
.replace(/\s+/g, ' ')
|
11
|
+
.replace(/\W+/g, '_')
|
12
|
+
.trim();
|
13
|
+
};
|
14
|
+
|
15
|
+
// Make sure all headings have an id so we can anchor to them
|
16
|
+
$('h1:not([id]), h2:not([id])').each(function() {
|
17
|
+
this.id = ['auto', (++guid), sanitizeText(this.innerText) ].join('_');
|
18
|
+
});
|
19
|
+
|
20
|
+
var mainHeaders = $('h1').toArray().map(function(h1) {
|
21
|
+
var $h1 = $(h1);
|
22
|
+
|
23
|
+
return {
|
24
|
+
id: h1.id,
|
25
|
+
comparator: sanitizeText($h1.text()),
|
26
|
+
children: $h1.nextAll('h2').toArray()
|
27
|
+
};
|
28
|
+
});
|
29
|
+
|
30
|
+
console.log(mainHeaders);
|
31
|
+
|
32
|
+
mainHeaders.forEach(function(header) {
|
33
|
+
var $subLinks;
|
34
|
+
var sidebarLink = $staticPages.find('a').filter(function() {
|
35
|
+
return sanitizeText($(this).text()) === header.comparator;
|
36
|
+
})[0];
|
37
|
+
|
38
|
+
if (!sidebarLink) {
|
39
|
+
console.warn('Unable to find sidebar entry for header %s', header.comparator);
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
$subLinks = $('<ul />');
|
44
|
+
|
45
|
+
header.children.forEach(function(el) {
|
46
|
+
var $el = $(el);
|
47
|
+
var $anchor = $('<a />', {
|
48
|
+
href: '#' + $el.attr('id')
|
49
|
+
}).text($el.text());
|
50
|
+
|
51
|
+
$('<li />').append($anchor).appendTo($subLinks);
|
52
|
+
});
|
53
|
+
|
54
|
+
$(sidebarLink).after($subLinks);
|
55
|
+
|
56
|
+
// finally, change the original anchor that points to the article file
|
57
|
+
// to point to the bookmark in the current page
|
58
|
+
sidebarLink.href = '#' + header.id;
|
59
|
+
});
|
60
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
$(function() {
|
2
|
+
var scrollSpySelector = $('#content h1');
|
3
|
+
|
4
|
+
$(scrollSpySelector).on('scrollSpy:enter', function() {
|
5
|
+
console.log('enter:', $(this).attr('id'));
|
6
|
+
});
|
7
|
+
|
8
|
+
$(scrollSpySelector).on('scrollSpy:exit', function() {
|
9
|
+
console.log('exit:', $(this).attr('id'));
|
10
|
+
});
|
11
|
+
|
12
|
+
$(scrollSpySelector).scrollSpy();
|
13
|
+
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
def stylesheets
|
2
|
-
theme = case api_options.theme
|
2
|
+
theme = case api_options.theme.downcase
|
3
3
|
when 'vroom'
|
4
4
|
'css/vroom.css'
|
5
5
|
when 'default', 'slate', 'slatelike'
|
@@ -14,4 +14,8 @@ def javascripts
|
|
14
14
|
js/scrollspy.js
|
15
15
|
js/slatelike.js
|
16
16
|
]
|
17
|
+
end
|
18
|
+
|
19
|
+
def inline_stylesheets
|
20
|
+
super + %w[ _styles ]
|
17
21
|
end
|
data/yard-api-slatelike.gemspec
CHANGED
@@ -11,12 +11,12 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.authors = ["Ahmad Amireh"]
|
12
12
|
s.email = 'ahmad@instructure.com'
|
13
13
|
s.homepage = 'https://github.com/amireh/yard-api-slatelike'
|
14
|
-
s.files = Dir.glob("{lib,spec,templates}
|
14
|
+
s.files = Dir.glob("{config,lib,spec,templates}/**/*") +
|
15
15
|
['LICENSE', 'README.md', '.rspec', __FILE__]
|
16
16
|
s.has_rdoc = 'yard'
|
17
17
|
s.license = 'AGPL3'
|
18
|
-
s.add_dependency 'yard', '0.8.7'
|
19
|
-
s.add_dependency 'yard-api', '
|
20
|
-
s.add_development_dependency 'rspec'
|
21
|
-
s.add_development_dependency 'gem-release'
|
18
|
+
s.add_dependency 'yard', '>=0.8.7', '<1.0.0'
|
19
|
+
s.add_dependency 'yard-api', '>=0.1.2', '<2.0.0'
|
20
|
+
s.add_development_dependency 'rspec'
|
21
|
+
s.add_development_dependency 'gem-release'
|
22
22
|
end
|
metadata
CHANGED
@@ -1,73 +1,84 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-api-slatelike
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmad Amireh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.8.7
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.0.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 0.8.7
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.0.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: yard-api
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
39
|
version: 0.1.2
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.0.0
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
|
-
- - "
|
47
|
+
- - ">="
|
39
48
|
- !ruby/object:Gem::Version
|
40
49
|
version: 0.1.2
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.0.0
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: rspec
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
44
56
|
requirements:
|
45
|
-
- - "
|
57
|
+
- - ">="
|
46
58
|
- !ruby/object:Gem::Version
|
47
59
|
version: '0'
|
48
60
|
type: :development
|
49
61
|
prerelease: false
|
50
62
|
version_requirements: !ruby/object:Gem::Requirement
|
51
63
|
requirements:
|
52
|
-
- - "
|
64
|
+
- - ">="
|
53
65
|
- !ruby/object:Gem::Version
|
54
66
|
version: '0'
|
55
67
|
- !ruby/object:Gem::Dependency
|
56
68
|
name: gem-release
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
58
70
|
requirements:
|
59
|
-
- - "
|
71
|
+
- - ">="
|
60
72
|
- !ruby/object:Gem::Version
|
61
73
|
version: '0'
|
62
74
|
type: :development
|
63
75
|
prerelease: false
|
64
76
|
version_requirements: !ruby/object:Gem::Requirement
|
65
77
|
requirements:
|
66
|
-
- - "
|
78
|
+
- - ">="
|
67
79
|
- !ruby/object:Gem::Version
|
68
80
|
version: '0'
|
69
|
-
description:
|
70
|
-
TBD
|
81
|
+
description: " TBD\n"
|
71
82
|
email: ahmad@instructure.com
|
72
83
|
executables: []
|
73
84
|
extensions: []
|
@@ -77,7 +88,16 @@ files:
|
|
77
88
|
- LICENSE
|
78
89
|
- README.md
|
79
90
|
- lib/yard-api-slatelike.rb
|
91
|
+
- lib/yard-api-slatelike/options.rb
|
80
92
|
- lib/yard-api-slatelike/version.rb
|
93
|
+
- templates/api/fulldoc/html/css/monokai.css
|
94
|
+
- templates/api/fulldoc/html/css/slatelike.css
|
95
|
+
- templates/api/fulldoc/html/css/vroom.css
|
96
|
+
- templates/api/fulldoc/html/js/scrollspy.js
|
97
|
+
- templates/api/fulldoc/html/js/slatelike.js
|
98
|
+
- templates/api/fulldoc/html/js/slatelike/nav.js
|
99
|
+
- templates/api/fulldoc/html/js/slatelike/nav_scrollspy.js
|
100
|
+
- templates/api/layout/html/_styles.erb
|
81
101
|
- templates/api/layout/html/setup.rb
|
82
102
|
- yard-api-slatelike.gemspec
|
83
103
|
homepage: https://github.com/amireh/yard-api-slatelike
|
@@ -100,9 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
120
|
version: '0'
|
101
121
|
requirements: []
|
102
122
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.7.6
|
104
124
|
signing_key:
|
105
125
|
specification_version: 4
|
106
126
|
summary: A template plugin for YARD-API for better output style.
|
107
127
|
test_files: []
|
108
|
-
has_rdoc: yard
|