yard-api 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -3
- data/config/yard_api.yml +10 -1
- data/lib/yard-api/options.rb +8 -0
- data/lib/yard-api/tags/argument_tag.rb +0 -10
- data/lib/yard-api/tags.rb +0 -1
- data/lib/yard-api/templates/helpers/base_helper.rb +16 -1
- data/lib/yard-api/templates/helpers/html_helper.rb +7 -0
- data/lib/yard-api/templates/helpers/route_helper.rb +8 -0
- data/lib/yard-api/verifier.rb +5 -6
- data/lib/yard-api/version.rb +1 -1
- data/tasks/yard_api.rake +1 -0
- data/templates/api/appendix/json/setup.rb +1 -22
- data/templates/api/fulldoc/html/css/common.css +155 -102
- data/templates/api/fulldoc/html/css/highlight.css +125 -42
- data/templates/api/{layout/html/scripts.erb → fulldoc/html/js/app.js} +24 -20
- data/templates/api/fulldoc/html/js/highlight/styles/mono-blue.css +125 -42
- data/templates/api/fulldoc/html/setup.rb +1 -1
- data/templates/api/fulldoc/json/setup.rb +4 -8
- data/templates/api/layout/html/_dynamic_styles.erb +36 -11
- data/templates/api/layout/html/layout.erb +3 -2
- data/templates/api/layout/html/setup.rb +9 -2
- data/templates/api/layout/html/sidebar.erb +5 -4
- data/templates/api/layout/json/setup.rb +0 -3
- data/templates/api/method_details/html/header.erb +14 -3
- data/templates/api/method_details/html/method_signature.erb +10 -2
- data/templates/api/method_details/html/setup.rb +10 -15
- data/templates/api/tags/html/_example_code_block.erb +44 -1
- data/templates/api/tags/html/argument/_list.erb +20 -15
- data/templates/api/tags/html/argument/_table.erb +1 -1
- data/templates/api/tags/html/argument.erb +2 -2
- data/templates/api/tags/html/example_request.erb +3 -3
- data/templates/api/tags/html/example_response.erb +2 -2
- data/templates/api/topic/html/method_details_list.erb +4 -4
- data/templates/api/topic/html/topic_doc.erb +5 -5
- metadata +3 -6
- data/templates/api/docstring/json/setup.rb +0 -4
- data/templates/api/fulldoc/html/js/highlight.zip +0 -0
- data/templates/api/topic/json/setup.rb +0 -25
@@ -1,70 +1,153 @@
|
|
1
1
|
/*
|
2
|
-
|
2
|
+
|
3
|
+
Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
|
4
|
+
|
3
5
|
*/
|
6
|
+
|
4
7
|
.hljs {
|
5
8
|
display: block;
|
6
9
|
overflow-x: auto;
|
7
10
|
padding: 0.5em;
|
8
|
-
background: #
|
11
|
+
background: #f0f0f0;
|
9
12
|
-webkit-text-size-adjust: none;
|
10
13
|
}
|
11
14
|
|
12
15
|
.hljs,
|
13
|
-
.hljs-
|
14
|
-
|
16
|
+
.hljs-subst,
|
17
|
+
.hljs-tag .hljs-title,
|
18
|
+
.nginx .hljs-title {
|
19
|
+
color: black;
|
15
20
|
}
|
16
21
|
|
17
|
-
.hljs-
|
22
|
+
.hljs-string,
|
18
23
|
.hljs-title,
|
19
|
-
.hljs-
|
20
|
-
.hljs-
|
21
|
-
.hljs-
|
22
|
-
.hljs-
|
23
|
-
|
24
|
+
.hljs-constant,
|
25
|
+
.hljs-parent,
|
26
|
+
.hljs-tag .hljs-value,
|
27
|
+
.hljs-rules .hljs-value,
|
28
|
+
.hljs-preprocessor,
|
29
|
+
.hljs-pragma,
|
30
|
+
.haml .hljs-symbol,
|
31
|
+
.ruby .hljs-symbol,
|
32
|
+
.ruby .hljs-symbol .hljs-string,
|
33
|
+
.hljs-template_tag,
|
34
|
+
.django .hljs-variable,
|
35
|
+
.smalltalk .hljs-class,
|
36
|
+
.hljs-addition,
|
37
|
+
.hljs-flow,
|
38
|
+
.hljs-stream,
|
39
|
+
.bash .hljs-variable,
|
40
|
+
.apache .hljs-tag,
|
41
|
+
.apache .hljs-cbracket,
|
42
|
+
.tex .hljs-command,
|
43
|
+
.tex .hljs-special,
|
44
|
+
.erlang_repl .hljs-function_or_atom,
|
45
|
+
.asciidoc .hljs-header,
|
46
|
+
.markdown .hljs-header,
|
47
|
+
.coffeescript .hljs-attribute {
|
48
|
+
color: #800;
|
24
49
|
}
|
25
50
|
|
51
|
+
.smartquote,
|
26
52
|
.hljs-comment,
|
53
|
+
.hljs-annotation,
|
54
|
+
.hljs-template_comment,
|
55
|
+
.diff .hljs-header,
|
27
56
|
.hljs-chunk,
|
28
|
-
.hljs-
|
29
|
-
|
57
|
+
.asciidoc .hljs-blockquote,
|
58
|
+
.markdown .hljs-blockquote {
|
59
|
+
color: #888;
|
30
60
|
}
|
31
61
|
|
32
|
-
.hljs-
|
33
|
-
.hljs-
|
34
|
-
.hljs-
|
35
|
-
.hljs-built_in,
|
62
|
+
.hljs-number,
|
63
|
+
.hljs-date,
|
64
|
+
.hljs-regexp,
|
36
65
|
.hljs-literal,
|
37
|
-
.hljs-
|
38
|
-
.hljs-
|
39
|
-
.hljs-
|
40
|
-
.hljs-
|
41
|
-
.hljs-
|
42
|
-
.hljs-
|
43
|
-
.hljs-
|
44
|
-
.hljs-
|
45
|
-
|
66
|
+
.hljs-hexcolor,
|
67
|
+
.smalltalk .hljs-symbol,
|
68
|
+
.smalltalk .hljs-char,
|
69
|
+
.go .hljs-constant,
|
70
|
+
.hljs-change,
|
71
|
+
.lasso .hljs-variable,
|
72
|
+
.makefile .hljs-variable,
|
73
|
+
.asciidoc .hljs-bullet,
|
74
|
+
.markdown .hljs-bullet,
|
75
|
+
.asciidoc .hljs-link_url,
|
76
|
+
.markdown .hljs-link_url {
|
77
|
+
color: #080;
|
46
78
|
}
|
47
79
|
|
80
|
+
.hljs-label,
|
81
|
+
.hljs-javadoc,
|
82
|
+
.ruby .hljs-string,
|
48
83
|
.hljs-decorator,
|
49
|
-
.hljs-
|
50
|
-
.hljs-
|
51
|
-
.hljs-
|
52
|
-
.hljs-symbol,
|
53
|
-
.hljs-doctype,
|
54
|
-
.hljs-regexp,
|
55
|
-
.hljs-preprocessor,
|
56
|
-
.hljs-pragma,
|
57
|
-
.hljs-pi,
|
58
|
-
.hljs-attribute,
|
84
|
+
.hljs-filter .hljs-argument,
|
85
|
+
.hljs-localvars,
|
86
|
+
.hljs-array,
|
59
87
|
.hljs-attr_selector,
|
60
|
-
.hljs-
|
61
|
-
.hljs-
|
88
|
+
.hljs-important,
|
89
|
+
.hljs-pseudo,
|
90
|
+
.hljs-pi,
|
91
|
+
.haml .hljs-bullet,
|
92
|
+
.hljs-doctype,
|
62
93
|
.hljs-deletion,
|
94
|
+
.hljs-envvar,
|
63
95
|
.hljs-shebang,
|
64
|
-
.
|
65
|
-
.hljs-
|
66
|
-
.hljs-
|
67
|
-
.hljs-
|
96
|
+
.apache .hljs-sqbracket,
|
97
|
+
.nginx .hljs-built_in,
|
98
|
+
.tex .hljs-formula,
|
99
|
+
.erlang_repl .hljs-reserved,
|
100
|
+
.hljs-prompt,
|
101
|
+
.asciidoc .hljs-link_label,
|
102
|
+
.markdown .hljs-link_label,
|
103
|
+
.vhdl .hljs-attribute,
|
104
|
+
.clojure .hljs-attribute,
|
105
|
+
.asciidoc .hljs-attribute,
|
106
|
+
.lasso .hljs-attribute,
|
107
|
+
.coffeescript .hljs-property,
|
68
108
|
.hljs-phony {
|
69
|
-
color: #
|
109
|
+
color: #88f;
|
110
|
+
}
|
111
|
+
|
112
|
+
.hljs-keyword,
|
113
|
+
.hljs-id,
|
114
|
+
.hljs-title,
|
115
|
+
.hljs-built_in,
|
116
|
+
.css .hljs-tag,
|
117
|
+
.hljs-javadoctag,
|
118
|
+
.hljs-phpdoc,
|
119
|
+
.hljs-dartdoc,
|
120
|
+
.hljs-yardoctag,
|
121
|
+
.smalltalk .hljs-class,
|
122
|
+
.hljs-winutils,
|
123
|
+
.bash .hljs-variable,
|
124
|
+
.apache .hljs-tag,
|
125
|
+
.hljs-type,
|
126
|
+
.hljs-typename,
|
127
|
+
.tex .hljs-command,
|
128
|
+
.asciidoc .hljs-strong,
|
129
|
+
.markdown .hljs-strong,
|
130
|
+
.hljs-request,
|
131
|
+
.hljs-status {
|
132
|
+
font-weight: bold;
|
133
|
+
}
|
134
|
+
|
135
|
+
.asciidoc .hljs-emphasis,
|
136
|
+
.markdown .hljs-emphasis {
|
137
|
+
font-style: italic;
|
138
|
+
}
|
139
|
+
|
140
|
+
.nginx .hljs-built_in {
|
141
|
+
font-weight: normal;
|
142
|
+
}
|
143
|
+
|
144
|
+
.coffeescript .javascript,
|
145
|
+
.javascript .xml,
|
146
|
+
.lasso .markup,
|
147
|
+
.tex .hljs-formula,
|
148
|
+
.xml .javascript,
|
149
|
+
.xml .vbscript,
|
150
|
+
.xml .css,
|
151
|
+
.xml .hljs-cdata {
|
152
|
+
opacity: 0.5;
|
70
153
|
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
$('
|
1
|
+
$(function() {
|
2
|
+
$('.method-details__name').each(function(i, el) {
|
3
3
|
var subtopic = $(el).data('subtopic');
|
4
4
|
var $a = $(el).find('a');
|
5
5
|
var anchorText = $.trim($a[0].innerHTML);
|
@@ -16,23 +16,6 @@
|
|
16
16
|
$('<li>').append($link).appendTo($row);
|
17
17
|
});
|
18
18
|
|
19
|
-
// Highlight the current page in the sidebar
|
20
|
-
$(function() {
|
21
|
-
var currentPage = location.pathname.match(/\/([^\/]+)$/)[1];
|
22
|
-
var $page = $('#sidebar [href="' + currentPage + '"]');
|
23
|
-
|
24
|
-
if (!currentPage) {
|
25
|
-
return;
|
26
|
-
}
|
27
|
-
|
28
|
-
// if ($page.length === 0) {
|
29
|
-
// $page = $('#sidebar a[href=""]');
|
30
|
-
// }
|
31
|
-
|
32
|
-
// $page.addClass('active');
|
33
|
-
console.log('Highlighting current page:', $page, currentPage);
|
34
|
-
});
|
35
|
-
|
36
19
|
$('#content pre').each(function(i, block) {
|
37
20
|
var code;
|
38
21
|
var $block = $(block);
|
@@ -49,4 +32,25 @@
|
|
49
32
|
|
50
33
|
hljs.highlightBlock(block);
|
51
34
|
});
|
52
|
-
|
35
|
+
|
36
|
+
// Make it so that clicking one of these "tabs" for every @example_request
|
37
|
+
// dialect switch to that dialect's example. For example: switching between
|
38
|
+
// the generated JSON and cURL examples when those anchors are clicked.
|
39
|
+
$('.example-codeblocks__tabs').each(function() {
|
40
|
+
var $examples = $(this).siblings('.example-codeblocks__example');
|
41
|
+
|
42
|
+
$(this).find('a').each(function(index) {
|
43
|
+
var $example = $examples.eq(index);
|
44
|
+
|
45
|
+
$(this).on('click', function() {
|
46
|
+
$examples.hide().removeClass('active');
|
47
|
+
$example.show().addClass('active');
|
48
|
+
|
49
|
+
$(this).siblings('a.active').removeClass('active');
|
50
|
+
$(this).addClass('active');
|
51
|
+
});
|
52
|
+
});
|
53
|
+
|
54
|
+
$(this).find('a:first').click();
|
55
|
+
});
|
56
|
+
});
|
@@ -1,70 +1,153 @@
|
|
1
1
|
/*
|
2
|
-
|
2
|
+
|
3
|
+
Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
|
4
|
+
|
3
5
|
*/
|
6
|
+
|
4
7
|
.hljs {
|
5
8
|
display: block;
|
6
9
|
overflow-x: auto;
|
7
10
|
padding: 0.5em;
|
8
|
-
background: #
|
11
|
+
background: #f0f0f0;
|
9
12
|
-webkit-text-size-adjust: none;
|
10
13
|
}
|
11
14
|
|
12
15
|
.hljs,
|
13
|
-
.hljs-
|
14
|
-
|
16
|
+
.hljs-subst,
|
17
|
+
.hljs-tag .hljs-title,
|
18
|
+
.nginx .hljs-title {
|
19
|
+
color: black;
|
15
20
|
}
|
16
21
|
|
17
|
-
.hljs-
|
22
|
+
.hljs-string,
|
18
23
|
.hljs-title,
|
19
|
-
.hljs-
|
20
|
-
.hljs-
|
21
|
-
.hljs-
|
22
|
-
.hljs-
|
23
|
-
|
24
|
+
.hljs-constant,
|
25
|
+
.hljs-parent,
|
26
|
+
.hljs-tag .hljs-value,
|
27
|
+
.hljs-rules .hljs-value,
|
28
|
+
.hljs-preprocessor,
|
29
|
+
.hljs-pragma,
|
30
|
+
.haml .hljs-symbol,
|
31
|
+
.ruby .hljs-symbol,
|
32
|
+
.ruby .hljs-symbol .hljs-string,
|
33
|
+
.hljs-template_tag,
|
34
|
+
.django .hljs-variable,
|
35
|
+
.smalltalk .hljs-class,
|
36
|
+
.hljs-addition,
|
37
|
+
.hljs-flow,
|
38
|
+
.hljs-stream,
|
39
|
+
.bash .hljs-variable,
|
40
|
+
.apache .hljs-tag,
|
41
|
+
.apache .hljs-cbracket,
|
42
|
+
.tex .hljs-command,
|
43
|
+
.tex .hljs-special,
|
44
|
+
.erlang_repl .hljs-function_or_atom,
|
45
|
+
.asciidoc .hljs-header,
|
46
|
+
.markdown .hljs-header,
|
47
|
+
.coffeescript .hljs-attribute {
|
48
|
+
color: #800;
|
24
49
|
}
|
25
50
|
|
51
|
+
.smartquote,
|
26
52
|
.hljs-comment,
|
53
|
+
.hljs-annotation,
|
54
|
+
.hljs-template_comment,
|
55
|
+
.diff .hljs-header,
|
27
56
|
.hljs-chunk,
|
28
|
-
.hljs-
|
29
|
-
|
57
|
+
.asciidoc .hljs-blockquote,
|
58
|
+
.markdown .hljs-blockquote {
|
59
|
+
color: #888;
|
30
60
|
}
|
31
61
|
|
32
|
-
.hljs-
|
33
|
-
.hljs-
|
34
|
-
.hljs-
|
35
|
-
.hljs-built_in,
|
62
|
+
.hljs-number,
|
63
|
+
.hljs-date,
|
64
|
+
.hljs-regexp,
|
36
65
|
.hljs-literal,
|
37
|
-
.hljs-
|
38
|
-
.hljs-
|
39
|
-
.hljs-
|
40
|
-
.hljs-
|
41
|
-
.hljs-
|
42
|
-
.hljs-
|
43
|
-
.hljs-
|
44
|
-
.hljs-
|
45
|
-
|
66
|
+
.hljs-hexcolor,
|
67
|
+
.smalltalk .hljs-symbol,
|
68
|
+
.smalltalk .hljs-char,
|
69
|
+
.go .hljs-constant,
|
70
|
+
.hljs-change,
|
71
|
+
.lasso .hljs-variable,
|
72
|
+
.makefile .hljs-variable,
|
73
|
+
.asciidoc .hljs-bullet,
|
74
|
+
.markdown .hljs-bullet,
|
75
|
+
.asciidoc .hljs-link_url,
|
76
|
+
.markdown .hljs-link_url {
|
77
|
+
color: #080;
|
46
78
|
}
|
47
79
|
|
80
|
+
.hljs-label,
|
81
|
+
.hljs-javadoc,
|
82
|
+
.ruby .hljs-string,
|
48
83
|
.hljs-decorator,
|
49
|
-
.hljs-
|
50
|
-
.hljs-
|
51
|
-
.hljs-
|
52
|
-
.hljs-symbol,
|
53
|
-
.hljs-doctype,
|
54
|
-
.hljs-regexp,
|
55
|
-
.hljs-preprocessor,
|
56
|
-
.hljs-pragma,
|
57
|
-
.hljs-pi,
|
58
|
-
.hljs-attribute,
|
84
|
+
.hljs-filter .hljs-argument,
|
85
|
+
.hljs-localvars,
|
86
|
+
.hljs-array,
|
59
87
|
.hljs-attr_selector,
|
60
|
-
.hljs-
|
61
|
-
.hljs-
|
88
|
+
.hljs-important,
|
89
|
+
.hljs-pseudo,
|
90
|
+
.hljs-pi,
|
91
|
+
.haml .hljs-bullet,
|
92
|
+
.hljs-doctype,
|
62
93
|
.hljs-deletion,
|
94
|
+
.hljs-envvar,
|
63
95
|
.hljs-shebang,
|
64
|
-
.
|
65
|
-
.hljs-
|
66
|
-
.hljs-
|
67
|
-
.hljs-
|
96
|
+
.apache .hljs-sqbracket,
|
97
|
+
.nginx .hljs-built_in,
|
98
|
+
.tex .hljs-formula,
|
99
|
+
.erlang_repl .hljs-reserved,
|
100
|
+
.hljs-prompt,
|
101
|
+
.asciidoc .hljs-link_label,
|
102
|
+
.markdown .hljs-link_label,
|
103
|
+
.vhdl .hljs-attribute,
|
104
|
+
.clojure .hljs-attribute,
|
105
|
+
.asciidoc .hljs-attribute,
|
106
|
+
.lasso .hljs-attribute,
|
107
|
+
.coffeescript .hljs-property,
|
68
108
|
.hljs-phony {
|
69
|
-
color: #
|
109
|
+
color: #88f;
|
110
|
+
}
|
111
|
+
|
112
|
+
.hljs-keyword,
|
113
|
+
.hljs-id,
|
114
|
+
.hljs-title,
|
115
|
+
.hljs-built_in,
|
116
|
+
.css .hljs-tag,
|
117
|
+
.hljs-javadoctag,
|
118
|
+
.hljs-phpdoc,
|
119
|
+
.hljs-dartdoc,
|
120
|
+
.hljs-yardoctag,
|
121
|
+
.smalltalk .hljs-class,
|
122
|
+
.hljs-winutils,
|
123
|
+
.bash .hljs-variable,
|
124
|
+
.apache .hljs-tag,
|
125
|
+
.hljs-type,
|
126
|
+
.hljs-typename,
|
127
|
+
.tex .hljs-command,
|
128
|
+
.asciidoc .hljs-strong,
|
129
|
+
.markdown .hljs-strong,
|
130
|
+
.hljs-request,
|
131
|
+
.hljs-status {
|
132
|
+
font-weight: bold;
|
133
|
+
}
|
134
|
+
|
135
|
+
.asciidoc .hljs-emphasis,
|
136
|
+
.markdown .hljs-emphasis {
|
137
|
+
font-style: italic;
|
138
|
+
}
|
139
|
+
|
140
|
+
.nginx .hljs-built_in {
|
141
|
+
font-weight: normal;
|
142
|
+
}
|
143
|
+
|
144
|
+
.coffeescript .javascript,
|
145
|
+
.javascript .xml,
|
146
|
+
.lasso .markup,
|
147
|
+
.tex .hljs-formula,
|
148
|
+
.xml .javascript,
|
149
|
+
.xml .vbscript,
|
150
|
+
.xml .css,
|
151
|
+
.xml .hljs-cdata {
|
152
|
+
opacity: 0.5;
|
70
153
|
}
|
@@ -26,13 +26,13 @@ def serialize_resource(resource, controllers)
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def method_details_list(controllers)
|
29
|
-
|
29
|
+
meths = controllers.map do |controller|
|
30
30
|
controller.meths(:inherited => false, :included => false)
|
31
31
|
end.flatten
|
32
32
|
|
33
|
-
|
33
|
+
meths = run_verifier(meths)
|
34
34
|
|
35
|
-
|
35
|
+
meths.map do |object, i|
|
36
36
|
dump_object(object).tap do |object_info|
|
37
37
|
object_info[:tags] = dump_object_tags(object)
|
38
38
|
end
|
@@ -94,10 +94,6 @@ def get_route(object)
|
|
94
94
|
route = routes.first
|
95
95
|
|
96
96
|
if route.present?
|
97
|
-
# controller_path = "app/controllers/#{route.requirements[:controller]}_controller.rb"
|
98
|
-
# controller_path = nil unless File.file?(Rails.root+controller_path)
|
99
|
-
|
100
|
-
route_path = route.path.spec.to_s.gsub("(.:format)", "")
|
101
97
|
verb = if route.verb.source =~ /\^?(\w*)\$/
|
102
98
|
$1.upcase
|
103
99
|
else
|
@@ -105,7 +101,7 @@ def get_route(object)
|
|
105
101
|
end
|
106
102
|
|
107
103
|
{
|
108
|
-
path:
|
104
|
+
path: route.path.spec.to_s.gsub("(.:format)", ""),
|
109
105
|
verb: verb
|
110
106
|
}
|
111
107
|
end
|
@@ -1,16 +1,41 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
#sidebar {
|
8
|
-
width: <%= api_options.sidebar_width %>px;
|
9
|
-
}
|
1
|
+
<%
|
2
|
+
content_width = api_options.content_width.to_i
|
3
|
+
content_width = 720 if content_width <= 0
|
4
|
+
sidebar_width = api_options.sidebar_width.to_i || 240
|
5
|
+
sidebar_width = 240 if sidebar_width <= 0
|
6
|
+
%>
|
10
7
|
|
11
|
-
|
8
|
+
<style>
|
9
|
+
<% if api_options.centered %>
|
10
|
+
body {
|
11
|
+
margin: 0 auto;
|
12
|
+
width: <%= content_width %>px;
|
13
|
+
}
|
14
|
+
|
15
|
+
#sidebar {
|
16
|
+
margin-left: -<%= sidebar_width %>px;
|
17
|
+
width: <%= sidebar_width %>px;
|
18
|
+
left: auto;
|
19
|
+
}
|
20
|
+
|
12
21
|
#content {
|
13
|
-
|
22
|
+
padding-left: 3em;
|
14
23
|
}
|
24
|
+
<% else %>
|
25
|
+
body {
|
26
|
+
padding-left: <%= sidebar_width + api_options.spacer %>px;
|
27
|
+
padding-right: <%= api_options.spacer %>px;
|
28
|
+
}
|
29
|
+
|
30
|
+
#sidebar {
|
31
|
+
width: <%= sidebar_width %>px;
|
32
|
+
}
|
33
|
+
|
34
|
+
<% if content_width > 0 %>
|
35
|
+
#content {
|
36
|
+
max-width: <%= content_width %>px;
|
37
|
+
}
|
38
|
+
<% end %>
|
39
|
+
|
15
40
|
<% end %>
|
16
41
|
</style>
|
@@ -32,6 +32,7 @@ def javascripts
|
|
32
32
|
%w[
|
33
33
|
js/jquery-1.11.1.min.js
|
34
34
|
js/highlight/highlight.pack.js
|
35
|
+
js/app.js
|
35
36
|
]
|
36
37
|
end
|
37
38
|
|
@@ -44,9 +45,15 @@ def contents
|
|
44
45
|
end
|
45
46
|
|
46
47
|
def index
|
47
|
-
legitimate_objects = @objects.reject
|
48
|
+
legitimate_objects = @objects.reject do |object|
|
49
|
+
object.root? ||
|
50
|
+
!is_class?(object) ||
|
51
|
+
!object.meths.find { |m| !m.tags('API').empty? }
|
52
|
+
end
|
48
53
|
|
49
|
-
@resources = legitimate_objects.sort_by
|
54
|
+
@resources = legitimate_objects.sort_by do |object|
|
55
|
+
object.tags('API').first.text
|
56
|
+
end
|
50
57
|
|
51
58
|
erb(:index)
|
52
59
|
end
|
@@ -4,17 +4,18 @@
|
|
4
4
|
<%= api_options['version'] %>
|
5
5
|
</h1>
|
6
6
|
|
7
|
-
<h2 class=
|
7
|
+
<h2 class="sidebar__heading">API</h2>
|
8
8
|
|
9
9
|
<nav id="static_pages">
|
10
|
-
<%= sidebar_link(
|
10
|
+
<%= sidebar_link(api_options.readme_page_title, 'index.html') %>
|
11
11
|
<% static_pages.each do |page| %>
|
12
12
|
<%= sidebar_link(page[:title], page[:filename]) %>
|
13
13
|
<% end %>
|
14
14
|
</nav>
|
15
15
|
|
16
|
-
<h2>Resources</h2>
|
17
|
-
|
16
|
+
<h2 class="sidebar__heading">Resources</h2>
|
17
|
+
|
18
|
+
<nav>
|
18
19
|
<% if api_options['resource_index'] %>
|
19
20
|
<%= sidebar_link('All Resources', 'all_resources.html') %>
|
20
21
|
<% end %>
|
@@ -1,18 +1,29 @@
|
|
1
|
-
<div class='
|
1
|
+
<div class='method-details'>
|
2
2
|
<h2
|
3
|
-
class='
|
3
|
+
class='method-details__name'
|
4
4
|
name='<%= @props[:method_link] %>'
|
5
5
|
data-subtopic='<%= @props[:subtopic] %>'
|
6
6
|
>
|
7
7
|
<a
|
8
8
|
name='<%= @props[:method_link] %>'
|
9
9
|
href='#<%= @props[:method_link] %>'
|
10
|
+
class='method-details__name-link'
|
10
11
|
>
|
11
12
|
<%= object.tag('API').text %>
|
12
13
|
</a>
|
13
14
|
|
15
|
+
<% if object.has_tag?('beta') && api_options["use_beta_flag"] %>
|
16
|
+
<span
|
17
|
+
class="method-details__beta-flag"
|
18
|
+
title="This API endpoint is not finalized, and there could be
|
19
|
+
breaking changes before its final release."
|
20
|
+
>
|
21
|
+
BETA
|
22
|
+
</span>
|
23
|
+
<% end %>
|
24
|
+
|
14
25
|
<% if @props[:path] && !api_options.github_url.to_s.empty? %>
|
15
|
-
<span class='
|
26
|
+
<span class='method-details__defined-in'>
|
16
27
|
<a href="<%= api_options.github_url %>/blob/<%= api_options.github_branch %>/<%= @props[:path] %>">
|
17
28
|
<%= "#{@props[:controller]}Controller\##{@props[:action]}" %>
|
18
29
|
</a>
|
@@ -6,8 +6,16 @@
|
|
6
6
|
end.join('/')
|
7
7
|
%>
|
8
8
|
|
9
|
-
<
|
9
|
+
<div class='endpoint__path'>
|
10
10
|
<span class="verb <%= route[:verb].downcase %>"><%= route[:verb] %></span>
|
11
11
|
<%= formatted_route_path %>
|
12
|
-
</
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<% if object.has_tag?('beta') && api_options["use_beta_banner"] %>
|
15
|
+
<p class='endpoint__beta-banner'>
|
16
|
+
BETA: This API endpoint is not finalized, and there could be breaking
|
17
|
+
changes before its final release.
|
18
|
+
</p>
|
19
|
+
<% end %>
|
13
20
|
<% end %>
|
21
|
+
|