ramlstyle 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,308 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <title><%= @raml.title %> API documentation</title>
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7
+ <meta name="generator" content="https://github.com/mmorga/ramlstyle <%= "config.ramlstyleVersion" %>">
8
+ <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/default.min.css">
10
+ <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
11
+ <script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
12
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/highlight.min.js"></script>
13
+ <script type="text/javascript">
14
+ $(document).ready(function() {
15
+ $('pre.collapse').collapse('show');
16
+ $('.page-header pre code, .top-resource-description pre code, code.example').each(function(i, block) {
17
+ hljs.highlightBlock(block);
18
+ });
19
+ $('[data-toggle]').click(function() {
20
+ var selector = $(this).data('target') + ' pre code';
21
+ $(selector).each(function(i, block) {
22
+ hljs.highlightBlock(block);
23
+ });
24
+ });
25
+ // open modal on hashes like #_action_get
26
+ $(window).bind('hashchange', function(e) {
27
+ var anchor_id = document.location.hash.substr(1); //strip #
28
+ var element = $('#' + anchor_id);
29
+ // do we have such element + is it a modal? --> show it
30
+ if (element.length && element.hasClass('collapse')) {
31
+ console.log('toggle ' + element);
32
+ element.collapse('toggle');
33
+ }
34
+ });
35
+ // execute hashchange on first page load
36
+ $(window).trigger('hashchange');
37
+ // remove url fragment on modal hide
38
+ $('.collapse').on('hidden.bs.collapse', function() {
39
+ if(history && history.replaceState) {
40
+ history.replaceState({}, '', '#');
41
+ }
42
+ });
43
+ });
44
+ </script>
45
+ <style>
46
+ .hljs {
47
+ background: transparent;
48
+ }
49
+ .parent {
50
+ color: #999;
51
+ }
52
+ .list-group-item > .badge {
53
+ float: none;
54
+ margin-right: 6px;
55
+ }
56
+ .panel-title > .methods {
57
+ float: right;
58
+ }
59
+ .badge {
60
+ border-radius: 0;
61
+ text-transform: uppercase;
62
+ width: 70px;
63
+ font-weight: normal;
64
+ color: #f3f3f6;
65
+ line-height: normal;
66
+ }
67
+ .badge_get {
68
+ background-color: #63a8e2;
69
+ }
70
+ .badge_post {
71
+ background-color: #6cbd7d;
72
+ }
73
+ .badge_put {
74
+ background-color: #22bac4;
75
+ }
76
+ .badge_delete {
77
+ background-color: #d26460;
78
+ }
79
+ .badge_patch {
80
+ background-color: #ccc444;
81
+ }
82
+ .list-group, .panel-group {
83
+ margin-bottom: 0;
84
+ }
85
+ .panel-group .panel+.panel-white {
86
+ margin-top: 0;
87
+ }
88
+ .panel-group .panel-white {
89
+ border-bottom: 1px solid #F5F5F5;
90
+ border-radius: 0;
91
+ }
92
+ .panel-white:last-child {
93
+ border-bottom-color: white;
94
+ -webkit-box-shadow: none;
95
+ box-shadow: none;
96
+ }
97
+ .panel-white .panel-heading {
98
+ background: white;
99
+ }
100
+ .tab-pane ul {
101
+ padding-left: 2em;
102
+ }
103
+ .tab-pane h2 {
104
+ font-size: 1.2em;
105
+ padding-bottom: 4px;
106
+ border-bottom: 1px solid #ddd;
107
+ }
108
+ .tab-pane h3 {
109
+ font-size: 1.1em;
110
+ }
111
+ .tab-content {
112
+ border-left: 1px solid #ddd;
113
+ border-right: 1px solid #ddd;
114
+ border-bottom: 1px solid #ddd;
115
+ padding: 10px;
116
+ }
117
+ #sidebar {
118
+ margin-top: 30px;
119
+ padding-right: 5px;
120
+ overflow: auto;
121
+ height: 90%;
122
+ }
123
+ .top-resource-description {
124
+ border-bottom: 1px solid #ddd;
125
+ background: #fcfcfc;
126
+ padding: 15px 15px 0 15px;
127
+ margin: -15px -15px 10px -15px;
128
+ }
129
+ .resource-description {
130
+ border-bottom: 1px solid #fcfcfc;
131
+ background: #fcfcfc;
132
+ padding: 15px 15px 0 15px;
133
+ margin: -15px -15px 10px -15px;
134
+ }
135
+ .resource-description p:last-child {
136
+ margin: 0;
137
+ }
138
+ .list-group .badge {
139
+ float: left;
140
+ }
141
+ .method_description {
142
+ margin-left: 85px;
143
+ }
144
+ .method_description p:last-child {
145
+ margin: 0;
146
+ }
147
+ .list-group-item {
148
+ cursor: pointer;
149
+ }
150
+ .list-group-item:hover {
151
+ background-color: #f5f5f5;
152
+ }
153
+ </style>
154
+ </head>
155
+ <body data-spy="scroll" data-target="#sidebar">
156
+ <div class="container">
157
+ <div class="row">
158
+ <div class="col-md-9" role="main">
159
+ <div class="page-header">
160
+ <h1>
161
+ <%= @raml.title %> API documentation
162
+ <% if @raml.version %>
163
+ <small>version <%= @raml.version %></small>
164
+ <% end %>
165
+ </h1>
166
+ <p><%= @raml.base_uri %></p>
167
+ <% for document in @raml.documents %>
168
+ <h3 id="<%= document.unique_id %>">
169
+ <a href="#<%= document.unique_id %>"><%= document.title %></a>
170
+ </h3>
171
+ <%= markdown(document.content) %>
172
+ <% end %>
173
+ </div>
174
+
175
+ <div class="panel panel-default">
176
+ <div class="panel-heading">
177
+ <a class="panel-toggle" data-toggle="collapse" href="#security-schemes" aria-expanded="false" aria-controls="security-schemes">
178
+ <h3 id="security-schemes-header" class="panel-title">Security Schemes <span class="caret" aria-hidden="true"></span></h3>
179
+ </a>
180
+ </div>
181
+
182
+ <% @raml.security_schemes.each do |scheme_name, security_scheme| %>
183
+ <div id="security-schemes" class="panel-body collapse">
184
+ <div class="top-resource-description">
185
+ <% if security_scheme.value['description'] %>
186
+ <%= markdown security_scheme.value['description'] %>
187
+ <% else %>
188
+ <%= scheme_name %>
189
+ <% end %>
190
+ </div>
191
+
192
+ <div class="panel-group">
193
+ <dl class="dl-horizontal">
194
+ <dt>Type</dt>
195
+ <dd><%= security_scheme.value['type'] %></dd>
196
+ <% if security_scheme.value['settings'] %>
197
+ <dt>Settings</dt>
198
+ <dd>
199
+ <table class="table">
200
+ <thead>
201
+ <th>Name</th>
202
+ <th>Value</th>
203
+ </thead>
204
+ <tbody>
205
+ <% security_scheme.value['settings'].each do |k, v| %>
206
+ <tr>
207
+ <td><%= k %></td>
208
+ <td><%= v %></td>
209
+ </tr>
210
+ <% end %>
211
+ </tbody>
212
+ </table>
213
+ <dd>
214
+ <% end %>
215
+ <% if security_scheme.value['described_by'] %>
216
+ <dt>Described By</dt>
217
+ <dd>
218
+ <!-- {{#with describedBy}} -->
219
+ <table class="table">
220
+ <caption>Headers</caption>
221
+ <thead>
222
+ <tr>
223
+ <th>Header</th>
224
+ <th>Description</th>
225
+ <th>Type</th>
226
+ </tr>
227
+ </thead>
228
+ <tbody>
229
+ <% security_scheme.value['described_by']['headers'].each do |header_name, header| %>
230
+ <tr>
231
+ <td><%= header_name %></td>
232
+ <td><%= header.description %></td>
233
+ <td><%= header.type %></td>
234
+ </tr>
235
+ <% end %>
236
+ </tbody>
237
+ </table>
238
+
239
+ <table class="table">
240
+ <caption>Responses</caption>
241
+ <thead>
242
+ <tr>
243
+ <th>HTTP Code</th>
244
+ <th>Description</th>
245
+ </tr>
246
+ </thead>
247
+ <tbody>
248
+ <% security_scheme.value['described_by']['responses'].each do |status_code, response| %>
249
+ <tr>
250
+ <td><%= status_code %></td>
251
+ <td><%= response.description %></td>
252
+ </tr>
253
+ <% end %>
254
+ </tbody>
255
+ </table>
256
+ </dd>
257
+ <% end %>
258
+ </dl>
259
+ </div>
260
+ </div>
261
+ <% end %>
262
+ </div>
263
+
264
+ <% for resource in @raml.resources.values %>
265
+ <div class="panel panel-default">
266
+ <div class="panel-heading">
267
+ <h3 id="<%= resource.unique_id %>" class="panel-title">
268
+ <% if resource.display_name %>
269
+ <%= resource.display_name %>
270
+ <% else %>
271
+ <%= resource.name %>
272
+ <% end %>
273
+ </h3>
274
+ </div>
275
+ <div class="panel-body">
276
+ <% if resource.description %>
277
+ <div class="top-resource-description">
278
+ <%= markdown(resource.description) %>
279
+ </div>
280
+ <% end %>
281
+ <div class="panel-group">
282
+ <%= render_resource resource %>
283
+ </div>
284
+ </div>
285
+ </div>
286
+ <% end %>
287
+ </div>
288
+ <div class="col-md-3">
289
+ <div id="sidebar" class="hidden-print affix" role="complementary">
290
+ <ul class="nav nav-pills nav-stacked">
291
+ <% for resource in @raml.resources.values %>
292
+ <li>
293
+ <a href="#<%= resource.unique_id%>">
294
+ <% if resource.display_name %>
295
+ <%= resource.display_name%>
296
+ <% else %>
297
+ <%= resource.name %>
298
+ <% end %>
299
+ </a>
300
+ </li>
301
+ <% end %>
302
+ </ul>
303
+ </div>
304
+ </div>
305
+ </div>
306
+ </div>
307
+ </body>
308
+ </html>
metadata ADDED
@@ -0,0 +1,264 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ramlstyle
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.3
5
+ platform: ruby
6
+ authors:
7
+ - Mark Morga
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: redcarpet
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: raml_ruby
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubycritic
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sandi_meter
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: bundler
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: minitest
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: guard
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: guard-minitest
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: mocha
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ description: Validates RAML file (and JSON schema), runs a configurable set of linting
196
+ rules, and produces HTML documentation.
197
+ email:
198
+ - markmorga@gmail.com
199
+ executables:
200
+ - ramlstyle
201
+ extensions: []
202
+ extra_rdoc_files: []
203
+ files:
204
+ - ".gitignore"
205
+ - ".rubocop.yml"
206
+ - ".travis.yml"
207
+ - Gemfile
208
+ - Gemfile.lock
209
+ - Guardfile
210
+ - LICENSE.txt
211
+ - README.md
212
+ - Rakefile
213
+ - bin/code_climate_reek
214
+ - bin/console
215
+ - bin/setup
216
+ - exe/ramlstyle
217
+ - lib/ramlstyle.rb
218
+ - lib/ramlstyle/cli_command.rb
219
+ - lib/ramlstyle/command/command_chain.rb
220
+ - lib/ramlstyle/command/document_command.rb
221
+ - lib/ramlstyle/command/end_chain.rb
222
+ - lib/ramlstyle/command/file_command.rb
223
+ - lib/ramlstyle/command/options.rb
224
+ - lib/ramlstyle/command/parse_command.rb
225
+ - lib/ramlstyle/command/review_command.rb
226
+ - lib/ramlstyle/command/settings.rb
227
+ - lib/ramlstyle/document.rb
228
+ - lib/ramlstyle/documentation/erb_context.rb
229
+ - lib/ramlstyle/documentation/renderer.rb
230
+ - lib/ramlstyle/documentation/renderer_factory.rb
231
+ - lib/ramlstyle/patch/node.rb
232
+ - lib/ramlstyle/patch/root.rb
233
+ - lib/ramlstyle/raml_parser.rb
234
+ - lib/ramlstyle/review.rb
235
+ - lib/ramlstyle/version.rb
236
+ - ramlstyle.gemspec
237
+ - sandi_meter/.sandi_meter
238
+ - templates/item.html.erb
239
+ - templates/resource.html.erb
240
+ - templates/template.html.erb
241
+ homepage: http://github.com/rackerlabs/ramlstyle
242
+ licenses: []
243
+ metadata: {}
244
+ post_install_message:
245
+ rdoc_options: []
246
+ require_paths:
247
+ - lib
248
+ required_ruby_version: !ruby/object:Gem::Requirement
249
+ requirements:
250
+ - - ">="
251
+ - !ruby/object:Gem::Version
252
+ version: '0'
253
+ required_rubygems_version: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ requirements: []
259
+ rubyforge_project:
260
+ rubygems_version: 2.6.8
261
+ signing_key:
262
+ specification_version: 4
263
+ summary: Cmd line tool to validate, lint, and document a RAML API.
264
+ test_files: []