nexmo-oas-renderer 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile.lock +16 -7
  4. data/lib/nexmo/oas/renderer/app.rb +2 -4
  5. data/lib/nexmo/oas/renderer/presenters/api_specification.rb +1 -1
  6. data/lib/nexmo/oas/renderer/presenters/open_api_specification.rb +1 -1
  7. data/lib/nexmo/oas/renderer/public/assets/stylesheets/nexmo-oas-renderer.css +1 -1
  8. data/lib/nexmo/oas/renderer/version.rb +1 -1
  9. data/lib/nexmo/oas/renderer/views/open_api/_model.erb +1 -1
  10. data/lib/nexmo/oas/renderer/views/open_api/_parameter_groups.erb +7 -37
  11. data/lib/nexmo/oas/renderer/views/open_api/_tabbed_parameters.erb +53 -0
  12. data/nexmo-oas-renderer.gemspec +1 -0
  13. metadata +17 -53
  14. data/lib/nexmo/oas/renderer/filters/anchor.rb +0 -17
  15. data/lib/nexmo/oas/renderer/filters/audio.rb +0 -21
  16. data/lib/nexmo/oas/renderer/filters/block_escape.rb +0 -24
  17. data/lib/nexmo/oas/renderer/filters/break.rb +0 -13
  18. data/lib/nexmo/oas/renderer/filters/code.rb +0 -64
  19. data/lib/nexmo/oas/renderer/filters/code_snippet.rb +0 -194
  20. data/lib/nexmo/oas/renderer/filters/code_snippet_list.rb +0 -33
  21. data/lib/nexmo/oas/renderer/filters/code_snippets.rb +0 -158
  22. data/lib/nexmo/oas/renderer/filters/collapsible.rb +0 -27
  23. data/lib/nexmo/oas/renderer/filters/columns.rb +0 -50
  24. data/lib/nexmo/oas/renderer/filters/concept_list.rb +0 -33
  25. data/lib/nexmo/oas/renderer/filters/dynamic_content.rb +0 -30
  26. data/lib/nexmo/oas/renderer/filters/external_link.rb +0 -32
  27. data/lib/nexmo/oas/renderer/filters/frontmatter.rb +0 -14
  28. data/lib/nexmo/oas/renderer/filters/heading.rb +0 -61
  29. data/lib/nexmo/oas/renderer/filters/icon.rb +0 -22
  30. data/lib/nexmo/oas/renderer/filters/indent.rb +0 -20
  31. data/lib/nexmo/oas/renderer/filters/inline_escape.rb +0 -17
  32. data/lib/nexmo/oas/renderer/filters/js_sequence_diagram.rb +0 -21
  33. data/lib/nexmo/oas/renderer/filters/label.rb +0 -32
  34. data/lib/nexmo/oas/renderer/filters/language.rb +0 -15
  35. data/lib/nexmo/oas/renderer/filters/markdown.rb +0 -85
  36. data/lib/nexmo/oas/renderer/filters/modal.rb +0 -41
  37. data/lib/nexmo/oas/renderer/filters/partial.rb +0 -28
  38. data/lib/nexmo/oas/renderer/filters/php_inliner.rb +0 -15
  39. data/lib/nexmo/oas/renderer/filters/screenshot.rb +0 -26
  40. data/lib/nexmo/oas/renderer/filters/tab.rb +0 -250
  41. data/lib/nexmo/oas/renderer/filters/techio.rb +0 -24
  42. data/lib/nexmo/oas/renderer/filters/tooltip.rb +0 -22
  43. data/lib/nexmo/oas/renderer/filters/tutorial_link.rb +0 -27
  44. data/lib/nexmo/oas/renderer/filters/tutorials.rb +0 -28
  45. data/lib/nexmo/oas/renderer/filters/unfreeze.rb +0 -20
  46. data/lib/nexmo/oas/renderer/filters/user_personalization.rb +0 -43
  47. data/lib/nexmo/oas/renderer/lib/core_ext/string.rb +0 -14
  48. data/lib/nexmo/oas/renderer/lib/redcarpet.rb +0 -14
  49. data/lib/nexmo/oas/renderer/models/code_snippet.rb +0 -75
  50. data/lib/nexmo/oas/renderer/models/tutorial.rb +0 -83
  51. data/lib/nexmo/oas/renderer/pipelines/markdown_pipeline.rb +0 -52
  52. data/lib/nexmo/oas/renderer/services/code_language_api.rb +0 -98
  53. data/lib/nexmo/oas/renderer/views/code_snippets/_application_messages_dispatch.html.erb +0 -9
  54. data/lib/nexmo/oas/renderer/views/code_snippets/_application_rtc.html.erb +0 -41
  55. data/lib/nexmo/oas/renderer/views/code_snippets/_application_voice.html.erb +0 -24
  56. data/lib/nexmo/oas/renderer/views/code_snippets/_code_only.html.erb +0 -6
  57. data/lib/nexmo/oas/renderer/views/code_snippets/_configure_client.html.erb +0 -20
  58. data/lib/nexmo/oas/renderer/views/code_snippets/_dependencies.html.erb +0 -11
  59. data/lib/nexmo/oas/renderer/views/code_snippets/_write_code.html.erb +0 -13
  60. data/lib/nexmo/oas/renderer/views/code_snippets/list/plain.html.erb +0 -10
  61. data/lib/nexmo/oas/renderer/views/tutorials/_index.html.erb +0 -32
  62. data/lib/nexmo/oas/renderer/views/tutorials/index.html.erb +0 -7
  63. data/lib/nexmo/oas/renderer/views/tutorials/list/plain.html.erb +0 -5
  64. data/lib/nexmo/oas/renderer/views/tutorials/show.html.erb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b851f13c8369bb28d71c4b0c6ec1fd9f000727b5eb361da8740fa7bae22e74db
4
- data.tar.gz: 5c516341b40d8dc5b0992456539367489b3298c08882a1aa425d8a5ed28331cd
3
+ metadata.gz: 3dd76a267e84f8ccf3b0b8ce454b0da5b9f8096245017fa28506579dc40959d8
4
+ data.tar.gz: 96243f54b8c1abd5c35476878da7d58963537ffc6359435b94a5d00448ca10d5
5
5
  SHA512:
6
- metadata.gz: c65dea2d20a585ba768cd3898c20e90c8684e14631ebab025a7a8f381576cd4d7b3d9732b78985a249b74c31a1bcb2bd23a2840b9d2fe750a3fe0c17f45a1c4d
7
- data.tar.gz: b7ebc350a3aec9cbc0e208b51051b2d8a7b6871f8a2e5cab0b56c243a96f269504ce49587cb66f2ecbcb8a0318869b9dc9c9e1cdbcc866f1d129ec381d2c16d8
6
+ metadata.gz: 11dfc1c031f31f027e605763d24149b4f4d423b086eb9ebad6968c4dc8bdfcd00460441771f7a88f43ec31fe688d1c392dfa6117f708e8989c425cdbc2d414ff
7
+ data.tar.gz: 713bd7323c2a24f2e3ae7a7c20fe2b815fafd316760f04e1f7d7713677fc28beba871c7efc35b76c804c41c6e576c3f71192273f147e1fd5848536a304081957
@@ -1,3 +1,10 @@
1
+ # 0.8.0
2
+ * Fix an issue when the description is `nil`
3
+ * Include nexmo-markdown-renderer
4
+ * Remove white box surrounding HTTP responses
5
+ * Allow multi-depth `oneOf` definitions
6
+ * Render endpoint's description as markdown
7
+
1
8
  # 0.7.1
2
9
  * Use schema's description when there isn't one at the parameter level
3
10
 
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nexmo-oas-renderer (0.7.0)
4
+ nexmo-oas-renderer (0.8.0)
5
5
  activemodel (~> 6.0)
6
6
  activesupport (~> 6.0)
7
7
  banzai (~> 0.1.2)
8
8
  dotenv (~> 2.7)
9
9
  neatjson (~> 0.8)
10
+ nexmo_markdown_renderer (>= 0.0.3)
10
11
  oas_parser (~> 0.23)
11
12
  octicons_helper (~> 8.2)
12
13
  redcarpet (= 3.4.0)
@@ -83,7 +84,7 @@ GEM
83
84
  diff-lcs (1.3)
84
85
  dotenv (2.7.5)
85
86
  erubi (1.9.0)
86
- ffi (1.11.3)
87
+ ffi (1.12.2)
87
88
  globalid (0.4.2)
88
89
  activesupport (>= 4.2.0)
89
90
  hansi (0.2.0)
@@ -107,6 +108,14 @@ GEM
107
108
  hansi (~> 0.2.0)
108
109
  mustermann (= 1.0.3)
109
110
  neatjson (0.9)
111
+ nexmo_markdown_renderer (0.0.3)
112
+ activemodel (~> 6.0)
113
+ banzai (~> 0.1.2)
114
+ i18n (~> 1.7)
115
+ nokogiri (~> 1.10)
116
+ octicons_helper (~> 8.2)
117
+ redcarpet (~> 3.4)
118
+ rouge (~> 2.0.7)
110
119
  nio4r (2.5.2)
111
120
  nokogiri (1.10.7)
112
121
  mini_portile2 (~> 2.4.0)
@@ -123,9 +132,9 @@ GEM
123
132
  octicons_helper (8.5.0)
124
133
  octicons (= 8.5.0)
125
134
  rails
126
- public_suffix (4.0.1)
135
+ public_suffix (4.0.3)
127
136
  rack (2.0.8)
128
- rack-protection (2.0.7)
137
+ rack-protection (2.0.8.1)
129
138
  rack
130
139
  rack-test (1.1.0)
131
140
  rack (>= 1.0, < 3)
@@ -157,7 +166,7 @@ GEM
157
166
  thor (>= 0.20.3, < 2.0)
158
167
  rake (10.5.0)
159
168
  rb-fsevent (0.10.3)
160
- rb-inotify (0.10.0)
169
+ rb-inotify (0.10.1)
161
170
  ffi (~> 1.0)
162
171
  redcarpet (3.4.0)
163
172
  rouge (2.0.7)
@@ -181,10 +190,10 @@ GEM
181
190
  rb-inotify (~> 0.9, >= 0.9.7)
182
191
  shotgun (0.9.2)
183
192
  rack (>= 1.0)
184
- sinatra (2.0.7)
193
+ sinatra (2.0.8.1)
185
194
  mustermann (~> 1.0)
186
195
  rack (~> 2.0)
187
- rack-protection (= 2.0.7)
196
+ rack-protection (= 2.0.8.1)
188
197
  tilt (~> 2.0)
189
198
  sprockets (3.7.2)
190
199
  concurrent-ruby (~> 1.0)
@@ -3,9 +3,9 @@ require 'active_support'
3
3
  require 'active_support/core_ext/array/conversions'
4
4
  require 'active_support/core_ext/string/output_safety'
5
5
  require 'active_model'
6
+ require 'nexmo_markdown_renderer'
6
7
 
7
8
  require_relative'./decorators/response_parser_decorator'
8
- require_relative'./pipelines/markdown_pipeline'
9
9
  require_relative'./presenters/api_specification'
10
10
  require_relative'./presenters/open_api_specification'
11
11
  require_relative'./presenters/navigation'
@@ -14,8 +14,6 @@ require_relative'./helpers/render'
14
14
  require_relative'./helpers/navigation'
15
15
  require_relative'./helpers/summary'
16
16
  require_relative'./helpers/url'
17
- require_relative './services/code_language_api'
18
- require_relative'./lib/core_ext/string'
19
17
 
20
18
  require 'dotenv/load'
21
19
 
@@ -129,7 +127,7 @@ module Nexmo
129
127
  @document = 'verify/templates'
130
128
  elsif params[:code_language] == 'ncco'
131
129
  @document = 'voice/ncco'
132
- elsif CodeLanguage.exists?(params[:code_language])
130
+ elsif ::Nexmo::Markdown::CodeLanguage.exists?(params[:code_language])
133
131
  @document = params[:document]
134
132
  else
135
133
  @document = "#{params[:document]}/#{params[:code_language]}"
@@ -36,7 +36,7 @@ module Nexmo
36
36
  def content
37
37
  options = {}
38
38
  options.merge(code_language: @code_language) if @code_language
39
- @content ||= MarkdownPipeline.new(options).call(document)
39
+ @content ||= Nexmo::Markdown::Renderer.new(options).call(document)
40
40
  end
41
41
  end
42
42
  end
@@ -30,7 +30,7 @@ module Nexmo
30
30
  end
31
31
 
32
32
  def definition_errors
33
- @definition_errors ||= MarkdownPipeline.new.call(
33
+ @definition_errors ||= Nexmo::Markdown::Renderer.new.call(
34
34
  File.read("#{API.oas_path}/../../errors/#{@definition_name}.md")
35
35
  ) if errors?
36
36
  end
@@ -88,7 +88,7 @@ body {
88
88
  top: 30px;
89
89
  position: sticky;
90
90
  display: block;
91
- overflow: scroll; }
91
+ overflow: auto; }
92
92
  .Nxd-api__code {
93
93
  background: #e7ebee;
94
94
  border-bottom: 1px solid #f8fafc;
@@ -1,7 +1,7 @@
1
1
  module Nexmo
2
2
  module OAS
3
3
  module Renderer
4
- VERSION = "0.7.1"
4
+ VERSION = "0.8.0"
5
5
  end
6
6
  end
7
7
  end
@@ -2,7 +2,7 @@
2
2
  <div class="Vlt-col Vlt-col--2of3 Nxd-api__docs">
3
3
  <div>
4
4
  <h2 id="<%= group['name'].parameterize %>" class='Vlt-grey-dark'><%= group['name'] %></h2>
5
- <p class: "Vlt-grey-darker"><%= group['description'] %></p>
5
+ <p class: "Vlt-grey-darker"><%= group['description']&.render_markdown %></p>
6
6
 
7
7
  <% if group['schema'] %>
8
8
  <% group['schema'].each do |format, schema| %>
@@ -49,41 +49,11 @@
49
49
 
50
50
  <%
51
51
  # This can likely be better done as a presenter, but it works for now
52
- panels = []
53
- endpoint.request_body.split_properties_for_format(format).each_with_index do |parameters, index|
54
- description = 'Request body'
55
- c = parameters[0].schema
56
- description = c['description'] if c['description']
57
- if c['allOf']
58
- c['allOf'].each_with_index do |current, index|
59
- description = c[index]['description'] if c[index]['description']
60
- end
61
- end
62
-
63
- panels.push({
64
- 'description' => description,
65
- 'parameters' => parameters,
66
- 'x-tab-id' => c['x-tab-id'],
67
- 'active' => index == 0
68
- })
69
- end
70
- %>
52
+ schema = endpoint.request_body.content[format]['schema']['oneOf']
53
+ %>
54
+ <%= erb :'open_api/_tabbed_parameters', locals: { body: endpoint.request_body, schema: schema, format: format, callback: callback } %>
55
+ <%
56
+ end
57
+ end
58
+ %>
71
59
 
72
- <div class="Vlt-tabs js-format" data-format="<%= format %>">
73
- <div class="Vlt-tabs__header" role="tablist" aria-label="Responses">
74
- <% panels.each do |panel| %>
75
- <div data-tab-link="<%= panel['x-tab-id'] %>" class="Vlt-tabs__link <%= panel['active'] ? 'Vlt-tabs__link_active' : '' %>">
76
- <%= panel['description'] %>
77
- </div>
78
- <% end %>
79
- </div>
80
- <div class="Vlt-tabs__content">
81
- <% panels.each do |panel| %>
82
- <div class="Vlt-tabs__panel <%= panel['active'] ? 'Vlt-tabs__panel_active' : '' %>">
83
- <%= erb :'open_api/_parameters', locals: { parameters: panel['parameters'], callback: callback } %>
84
- </div>
85
- <% end %>
86
- </div>
87
- </div>
88
- <% end %>
89
- <% end %>
@@ -0,0 +1,53 @@
1
+ <%
2
+ # Handle any cases where the top level of the oneOf is an allOf
3
+ schemas = schema.map { |s| body.handle_all_of(s) }
4
+
5
+ panels = []
6
+
7
+ schemas.each_with_index do |schema, index|
8
+ if schema['properties']
9
+ schema['properties'] = schema['properties'].map do |name, definition|
10
+ OasParser::Property.new(self, schema, name, definition)
11
+ end
12
+ .sort_by do |prop|
13
+ prop.required ? -1 : 1
14
+ end
15
+ end
16
+
17
+ panels.push({
18
+ 'description' => schema['title'] || schema['description'],
19
+ 'parameters' => schema['properties'],
20
+ 'oneOf' => schema['oneOf'],
21
+ 'x-tab-id' => schema['x-tab-id'],
22
+ 'active' => index == 0
23
+ })
24
+ end
25
+ %>
26
+
27
+ <div class="Vlt-tabs js-format" data-format="<%= format %>">
28
+ <div class="Vlt-tabs__header" role="tablist" aria-label="Responses">
29
+ <% panels.each do |panel| %>
30
+ <div data-tab-link="<%= panel['x-tab-id'] %>" class="Vlt-tabs__link <%= panel['active'] ? 'Vlt-tabs__link_active' : '' %>">
31
+ <%= panel['description'] %>
32
+ </div>
33
+ <% end %>
34
+ </div>
35
+ <div class="Vlt-tabs__content">
36
+ <% panels.each do |panel| %>
37
+ <div class="Vlt-tabs__panel <%= panel['active'] ? 'Vlt-tabs__panel_active' : '' %>">
38
+ <%
39
+ # Nested oneOf?
40
+ if panel['oneOf']
41
+ %>
42
+ <%= erb :'open_api/_tabbed_parameters', locals: { body: body, schema: panel['oneOf'], format: format, callback: callback } %>
43
+ <%
44
+ else
45
+ %>
46
+
47
+ <%= erb :'open_api/_parameters', locals: { parameters: panel['parameters'], callback: callback } %>
48
+ <% end %>
49
+ </div>
50
+ <% end %>
51
+ </div>
52
+ </div>
53
+
@@ -43,6 +43,7 @@ Gem::Specification.new do |spec|
43
43
  spec.add_runtime_dependency 'sass', '~> 3.1'
44
44
  spec.add_runtime_dependency 'activemodel', '~> 6.0'
45
45
  spec.add_runtime_dependency "dotenv", "~> 2.7"
46
+ spec.add_runtime_dependency 'nexmo_markdown_renderer', '>= 0.0.3'
46
47
 
47
48
  spec.add_development_dependency "bundler", "~> 2.0"
48
49
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexmo-oas-renderer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabian Rodriguez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-07 00:00:00.000000000 Z
11
+ date: 2020-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -178,6 +178,20 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '2.7'
181
+ - !ruby/object:Gem::Dependency
182
+ name: nexmo_markdown_renderer
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: 0.0.3
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: 0.0.3
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: bundler
183
197
  requirement: !ruby/object:Gem::Requirement
@@ -250,48 +264,10 @@ files:
250
264
  - lib/nexmo/oas/renderer/config/code_languages.yml
251
265
  - lib/nexmo/oas/renderer/config/dynamic_content.yml
252
266
  - lib/nexmo/oas/renderer/decorators/response_parser_decorator.rb
253
- - lib/nexmo/oas/renderer/filters/anchor.rb
254
- - lib/nexmo/oas/renderer/filters/audio.rb
255
- - lib/nexmo/oas/renderer/filters/block_escape.rb
256
- - lib/nexmo/oas/renderer/filters/break.rb
257
- - lib/nexmo/oas/renderer/filters/code.rb
258
- - lib/nexmo/oas/renderer/filters/code_snippet.rb
259
- - lib/nexmo/oas/renderer/filters/code_snippet_list.rb
260
- - lib/nexmo/oas/renderer/filters/code_snippets.rb
261
- - lib/nexmo/oas/renderer/filters/collapsible.rb
262
- - lib/nexmo/oas/renderer/filters/columns.rb
263
- - lib/nexmo/oas/renderer/filters/concept_list.rb
264
- - lib/nexmo/oas/renderer/filters/dynamic_content.rb
265
- - lib/nexmo/oas/renderer/filters/external_link.rb
266
- - lib/nexmo/oas/renderer/filters/frontmatter.rb
267
- - lib/nexmo/oas/renderer/filters/heading.rb
268
- - lib/nexmo/oas/renderer/filters/icon.rb
269
- - lib/nexmo/oas/renderer/filters/indent.rb
270
- - lib/nexmo/oas/renderer/filters/inline_escape.rb
271
- - lib/nexmo/oas/renderer/filters/js_sequence_diagram.rb
272
- - lib/nexmo/oas/renderer/filters/label.rb
273
- - lib/nexmo/oas/renderer/filters/language.rb
274
- - lib/nexmo/oas/renderer/filters/markdown.rb
275
- - lib/nexmo/oas/renderer/filters/modal.rb
276
- - lib/nexmo/oas/renderer/filters/partial.rb
277
- - lib/nexmo/oas/renderer/filters/php_inliner.rb
278
- - lib/nexmo/oas/renderer/filters/screenshot.rb
279
- - lib/nexmo/oas/renderer/filters/tab.rb
280
- - lib/nexmo/oas/renderer/filters/techio.rb
281
- - lib/nexmo/oas/renderer/filters/tooltip.rb
282
- - lib/nexmo/oas/renderer/filters/tutorial_link.rb
283
- - lib/nexmo/oas/renderer/filters/tutorials.rb
284
- - lib/nexmo/oas/renderer/filters/unfreeze.rb
285
- - lib/nexmo/oas/renderer/filters/user_personalization.rb
286
267
  - lib/nexmo/oas/renderer/helpers/navigation.rb
287
268
  - lib/nexmo/oas/renderer/helpers/render.rb
288
269
  - lib/nexmo/oas/renderer/helpers/summary.rb
289
270
  - lib/nexmo/oas/renderer/helpers/url.rb
290
- - lib/nexmo/oas/renderer/lib/core_ext/string.rb
291
- - lib/nexmo/oas/renderer/lib/redcarpet.rb
292
- - lib/nexmo/oas/renderer/models/code_snippet.rb
293
- - lib/nexmo/oas/renderer/models/tutorial.rb
294
- - lib/nexmo/oas/renderer/pipelines/markdown_pipeline.rb
295
271
  - lib/nexmo/oas/renderer/presenters/api_specification.rb
296
272
  - lib/nexmo/oas/renderer/presenters/endpoint.rb
297
273
  - lib/nexmo/oas/renderer/presenters/groups.rb
@@ -344,20 +320,11 @@ files:
344
320
  - lib/nexmo/oas/renderer/public/assets/stylesheets/volta.min.css
345
321
  - lib/nexmo/oas/renderer/public/assets/symbol/volta-icons.svg
346
322
  - lib/nexmo/oas/renderer/public/favicon.ico
347
- - lib/nexmo/oas/renderer/services/code_language_api.rb
348
323
  - lib/nexmo/oas/renderer/services/oas_parser.rb
349
324
  - lib/nexmo/oas/renderer/services/open_api_definition_resolver.rb
350
325
  - lib/nexmo/oas/renderer/version.rb
351
326
  - lib/nexmo/oas/renderer/views/api/index.erb
352
327
  - lib/nexmo/oas/renderer/views/api/show.erb
353
- - lib/nexmo/oas/renderer/views/code_snippets/_application_messages_dispatch.html.erb
354
- - lib/nexmo/oas/renderer/views/code_snippets/_application_rtc.html.erb
355
- - lib/nexmo/oas/renderer/views/code_snippets/_application_voice.html.erb
356
- - lib/nexmo/oas/renderer/views/code_snippets/_code_only.html.erb
357
- - lib/nexmo/oas/renderer/views/code_snippets/_configure_client.html.erb
358
- - lib/nexmo/oas/renderer/views/code_snippets/_dependencies.html.erb
359
- - lib/nexmo/oas/renderer/views/code_snippets/_write_code.html.erb
360
- - lib/nexmo/oas/renderer/views/code_snippets/list/plain.html.erb
361
328
  - lib/nexmo/oas/renderer/views/concepts/list/plain.html.erb
362
329
  - lib/nexmo/oas/renderer/views/layouts/_head.erb
363
330
  - lib/nexmo/oas/renderer/views/layouts/_javascripts.erb
@@ -375,12 +342,9 @@ files:
375
342
  - lib/nexmo/oas/renderer/views/open_api/_response_descriptions.erb
376
343
  - lib/nexmo/oas/renderer/views/open_api/_response_fields.erb
377
344
  - lib/nexmo/oas/renderer/views/open_api/_response_tabs.erb
345
+ - lib/nexmo/oas/renderer/views/open_api/_tabbed_parameters.erb
378
346
  - lib/nexmo/oas/renderer/views/open_api/show.erb
379
347
  - lib/nexmo/oas/renderer/views/static/404.erb
380
- - lib/nexmo/oas/renderer/views/tutorials/_index.html.erb
381
- - lib/nexmo/oas/renderer/views/tutorials/index.html.erb
382
- - lib/nexmo/oas/renderer/views/tutorials/list/plain.html.erb
383
- - lib/nexmo/oas/renderer/views/tutorials/show.html.erb
384
348
  - nexmo-oas-renderer.gemspec
385
349
  homepage: https://github.com/Nexmo/nexmo-oas-renderer
386
350
  licenses:
@@ -1,17 +0,0 @@
1
- module Nexmo
2
- module OAS
3
- module Renderer
4
- module Filters
5
- class Anchor < Banzai::Filter
6
- def call(input)
7
- input.gsub(/^[\u{2693}](.+?)\n/) do
8
- <<~HEREDOC
9
- <a name="#{$1.parameterize}"></a>
10
- HEREDOC
11
- end
12
- end
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,21 +0,0 @@
1
- module Nexmo
2
- module OAS
3
- module Renderer
4
- module Filters
5
- class Audio < Banzai::Filter
6
- def call(input)
7
- input.gsub(/[u{🔈}]\[(.+?)\]/) do
8
- audio = <<~HEREDOC
9
- <audio controls>
10
- <source src="#{$1}" type="audio/mpeg">
11
- </audio>
12
- HEREDOC
13
-
14
- "FREEZESTART#{Base64.urlsafe_encode64(audio)}FREEZEEND"
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,24 +0,0 @@
1
- module Nexmo
2
- module OAS
3
- module Renderer
4
- module Filters
5
- class BlockEscape < Banzai::Filter
6
- def call(input)
7
- # Freeze to prevent Markdown formatting
8
- input.gsub(/````\n(.+?)````/m) do |_s|
9
- lexer = Rouge::Lexer.find('text')
10
- formatter = Rouge::Formatters::HTML.new
11
- highlighted_source = formatter.format(lexer.lex($1))
12
-
13
- output = <<~HEREDOC
14
- <pre class="highlight #{lexer.tag}"><code>#{highlighted_source}</code></pre>
15
- HEREDOC
16
-
17
- "FREEZESTART#{Base64.urlsafe_encode64(output)}FREEZEEND"
18
- end
19
- end
20
- end
21
- end
22
- end
23
- end
24
- end