station 0.0.109 → 0.0.114

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +9 -7
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +2 -2
  5. data/docs/How-To-Use.md +2 -0
  6. data/lib/nexmo_developer/.nvmrc +1 -1
  7. data/lib/nexmo_developer/.ruby-version +1 -1
  8. data/lib/nexmo_developer/Gemfile +17 -28
  9. data/lib/nexmo_developer/Gemfile.lock +107 -119
  10. data/lib/nexmo_developer/Runbook.md +4 -4
  11. data/lib/nexmo_developer/app/assets/config/manifest.js +1 -4
  12. data/lib/nexmo_developer/app/assets/javascripts/application.js +2 -7
  13. data/lib/nexmo_developer/app/assets/stylesheets/application.css +1 -1
  14. data/lib/nexmo_developer/app/controllers/dashboard_controller.rb +0 -5
  15. data/lib/nexmo_developer/app/controllers/jobs_controller.rb +7 -7
  16. data/lib/nexmo_developer/app/controllers/static_controller.rb +5 -14
  17. data/lib/nexmo_developer/app/models/feedback/feedback.rb +2 -0
  18. data/lib/nexmo_developer/app/presenters/head.rb +5 -1
  19. data/lib/nexmo_developer/app/presenters/improve_page_presenter.rb +10 -7
  20. data/lib/nexmo_developer/app/services/orbit_feedback_notifier.rb +53 -0
  21. data/lib/nexmo_developer/app/services/translator/files_list_coordinator.rb +1 -1
  22. data/lib/nexmo_developer/app/services/translator/smartling/api/download_file.rb +6 -1
  23. data/lib/nexmo_developer/app/services/translator/smartling/api/file_status.rb +7 -1
  24. data/lib/nexmo_developer/app/services/translator/utils.rb +1 -1
  25. data/lib/nexmo_developer/app/views/contribute/guides/landing-pages.md +0 -10
  26. data/lib/nexmo_developer/app/views/contribute/guides/markdown-guide.md +36 -40
  27. data/lib/nexmo_developer/app/views/contribute/guides/platform.md +0 -1
  28. data/lib/nexmo_developer/app/views/dashboard/stats.html.erb +2 -2
  29. data/lib/nexmo_developer/app/views/layouts/partials/_head.html.erb +0 -5
  30. data/lib/nexmo_developer/app/views/static/default_landing/partials/_join_slack.html.erb +1 -1
  31. data/lib/nexmo_developer/app/views/static/{robots.txt.erb → robots.text.erb} +0 -0
  32. data/lib/nexmo_developer/app/webpacker/fonts/Lato-Black.woff +0 -0
  33. data/lib/nexmo_developer/app/webpacker/fonts/Lato-Black.woff2 +0 -0
  34. data/lib/nexmo_developer/app/webpacker/fonts/Lato-Regular.woff +0 -0
  35. data/lib/nexmo_developer/app/webpacker/fonts/Lato-Regular.woff2 +0 -0
  36. data/lib/nexmo_developer/app/webpacker/fonts/Lato-Semibold.woff +0 -0
  37. data/lib/nexmo_developer/app/webpacker/fonts/Lato-Semibold.woff2 +0 -0
  38. data/lib/nexmo_developer/app/webpacker/fonts/icomoon.eot +0 -0
  39. data/lib/nexmo_developer/app/webpacker/fonts/icomoon.json +1257 -0
  40. data/lib/nexmo_developer/app/webpacker/fonts/icomoon.svg +55 -0
  41. data/lib/nexmo_developer/app/webpacker/fonts/icomoon.ttf +0 -0
  42. data/lib/nexmo_developer/app/webpacker/fonts/icomoon.woff +0 -0
  43. data/lib/nexmo_developer/app/{assets → webpacker}/images/.keep +0 -0
  44. data/lib/nexmo_developer/app/{assets → webpacker}/images/logo@3x.png +0 -0
  45. data/lib/nexmo_developer/app/{assets → webpacker}/images/logo_vonage.png +0 -0
  46. data/lib/nexmo_developer/app/{assets → webpacker}/images/nexmo-developer-logo.svg +0 -0
  47. data/lib/nexmo_developer/app/{assets → webpacker}/images/nexmo-logo-collapsed.svg +0 -0
  48. data/lib/nexmo_developer/app/{assets → webpacker}/images/nexmo-vonage-white.svg +0 -0
  49. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/chatapp.jpg +0 -0
  50. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/chatapp_small.png +0 -0
  51. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/nexmo.jpg +0 -0
  52. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/numberinsight.jpg +0 -0
  53. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/numberinsight_small.png +0 -0
  54. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/sms.jpg +0 -0
  55. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/sms_small.png +0 -0
  56. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/verify.jpg +0 -0
  57. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/verify_small.png +0 -0
  58. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/voice.jpg +0 -0
  59. data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/voice_small.png +0 -0
  60. data/lib/nexmo_developer/app/{assets → webpacker}/images/select-dropdown.png +0 -0
  61. data/lib/nexmo_developer/app/{assets → webpacker}/images/slack.svg +0 -0
  62. data/lib/nexmo_developer/app/{assets → webpacker}/images/themes/ea/topography.png +0 -0
  63. data/lib/nexmo_developer/app/webpacker/javascript/code_snippet_events/index.js +23 -85
  64. data/lib/nexmo_developer/app/webpacker/javascript/volta/volta.js +5 -1
  65. data/lib/nexmo_developer/app/webpacker/packs/active_admin.js +5 -0
  66. data/lib/nexmo_developer/app/webpacker/packs/active_admin/print.scss +2 -0
  67. data/lib/nexmo_developer/app/webpacker/packs/application.js +12 -3
  68. data/lib/nexmo_developer/app/{assets → webpacker}/stylesheets/active_admin.scss +4 -4
  69. data/lib/nexmo_developer/app/webpacker/stylesheets/application.scss +0 -1
  70. data/lib/nexmo_developer/config/environments/development.rb +1 -1
  71. data/lib/nexmo_developer/config/initializers/active_admin.rb +3 -0
  72. data/lib/nexmo_developer/config/routes.rb +0 -2
  73. data/lib/nexmo_developer/config/webpack/environment.js +10 -0
  74. data/lib/nexmo_developer/config/webpack/plugins/jquery.js +7 -0
  75. data/lib/nexmo_developer/lib/tasks/cache.rake +1 -1
  76. data/lib/nexmo_developer/lib/tasks/careers.rake +1 -1
  77. data/lib/nexmo_developer/lib/tasks/ci.rake +7 -7
  78. data/lib/nexmo_developer/lib/tasks/diff.rake +5 -5
  79. data/lib/nexmo_developer/lib/tasks/documentation.rake +1 -1
  80. data/lib/nexmo_developer/lib/tasks/generate_search_terms.rake +2 -2
  81. data/lib/nexmo_developer/lib/tasks/links.rake +6 -6
  82. data/lib/nexmo_developer/lib/tasks/smartling.rake +1 -1
  83. data/lib/nexmo_developer/nexmo_developer.rb +3 -4
  84. data/lib/nexmo_developer/version.rb +1 -1
  85. data/package.json +29 -23
  86. data/station.gemspec +10 -14
  87. data/yarn.lock +2013 -3375
  88. metadata +206 -232
  89. data/lib/nexmo_developer/.dockerignore +0 -1
  90. data/lib/nexmo_developer/Dockerfile +0 -28
  91. data/lib/nexmo_developer/app/assets/javascripts/active_admin.js.coffee +0 -1
  92. data/lib/nexmo_developer/app/assets/javascripts/stats.js +0 -14
  93. data/lib/nexmo_developer/app/assets/regex/matching_chars.rb +0 -1
  94. data/lib/nexmo_developer/app/assets/regex/sequence_diagram_regex.rb +0 -1
  95. data/lib/nexmo_developer/app/assets/regex/stats_regex.rb +0 -1
  96. data/lib/nexmo_developer/app/assets/regex/webfont_regex.rb +0 -1
  97. data/lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js +0 -44
  98. data/lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js +0 -44
  99. data/lib/nexmo_developer/app/views/static/default_landing/partials/_submit_your_idea_form.html.erb +0 -58
  100. data/lib/nexmo_developer/app/webpacker/javascript/spotlight/index.js +0 -12
  101. data/lib/nexmo_developer/app/webpacker/stylesheets/objects/_building-block.scss +0 -32
  102. data/lib/nexmo_developer/docker-compose.yml +0 -43
  103. data/lib/nexmo_developer/lib/tasks/screenshots.rake +0 -11
  104. data/lib/nexmo_developer/vendor/assets/javascripts/jquery-scrolltofixed.js +0 -567
  105. data/lib/nexmo_developer/vendor/assets/javascripts/mermaid.js +0 -49
  106. data/lib/nexmo_developer/vendor/assets/javascripts/underscore.js +0 -5
  107. data/lib/nexmo_developer/vendor/assets/javascripts/volta/addons/jquery.tablesorter.js +0 -1031
  108. data/lib/nexmo_developer/vendor/assets/javascripts/volta/addons/prism.js +0 -22
  109. data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/side-navigation/volta.menu.js +0 -377
  110. data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.accordion.js +0 -249
  111. data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.dropdown.js +0 -145
  112. data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.flash.js +0 -175
  113. data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.modal.js +0 -312
  114. data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.tab.js +0 -203
  115. data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.tooltip.js +0 -71
  116. data/lib/nexmo_developer/vendor/assets/javascripts/volta/popper.min.js +0 -5
  117. data/lib/nexmo_developer/vendor/assets/javascripts/volta/svgxuse.min.js +0 -12
  118. data/lib/nexmo_developer/vendor/assets/javascripts/volta/tooltip.min.js +0 -5
  119. data/lib/nexmo_developer/vendor/assets/javascripts/volta/volta.core.js +0 -238
  120. data/lib/nexmo_developer/vendor/assets/javascripts/volta/volta.js +0 -2141
  121. data/lib/nexmo_developer/vendor/assets/javascripts/volta/volta.min.js +0 -1
@@ -4,7 +4,7 @@ Nexmo Developer is a simple Rails application with a mounted Sinatra app that ha
4
4
 
5
5
  # Deployment
6
6
 
7
- NDP is hosted in Heroku and is automatically deployed every time a branch is merged into master via a Github integration.
7
+ NDP is hosted in Heroku and is automatically deployed every time a branch is merged into main via a Github integration.
8
8
  In case you want to force a deploy, you can always deploy NDP from [Heroku's dashboard](https://dashboard.heroku.com/apps/nexmo-developer).
9
9
 
10
10
  ## Required Resources
@@ -39,7 +39,7 @@ In case NDP is Down:
39
39
 
40
40
  * Check if [Heroku](https://status.heroku.com/) is having an outage. Unfortunately, if that is the case then there isn't much you can do about it (at least for now).
41
41
  * Otherwise, check the [logs](#logs) or [Bugsnag](#error-monitoring-and-reporting) to see if any issues show up and try to reproduce it locally.
42
- If the issue is related to the latest deploy, just revert the offending commits and the deploy again while you work on a fix. Once a fix is ready, open a Pull Request, make sure that it works in the corresponding Review App and finally after all the checks pass merge it into master.
42
+ If the issue is related to the latest deploy, just revert the offending commits and the deploy again while you work on a fix. Once a fix is ready, open a Pull Request, make sure that it works in the corresponding Review App and finally after all the checks pass merge it into main.
43
43
 
44
44
  # Available configuration options
45
45
 
@@ -53,7 +53,7 @@ To enable the Search form locally, the `ALGOLIA_SEARCH_KEY` environment variable
53
53
 
54
54
  # Common issues when running NDP locally
55
55
 
56
- NDP can be run locally either directly or using Docker, for more information about how to run it see the [Readme](https://github.com/Nexmo/nexmo-developer/blob/master/README.md#running-locally). When using docker, re-building the image should fix the following issues
56
+ NDP can be run locally either directly or using Docker, for more information about how to run it see the [Readme](https://github.com/Nexmo/nexmo-developer/blob/main/README.md#running-locally). When using docker, re-building the image should fix the following issues
57
57
 
58
58
  * `Could not find definition '<insert_file_here>' in '<path>'`: set the right `OAS_PATH` in `.env`, check `.env.example` for the default value.
59
59
 
@@ -66,4 +66,4 @@ NDP can be run locally either directly or using Docker, for more information abo
66
66
 
67
67
  * Webpacker errors:
68
68
  * `The engine "node" is incompatible with this module. Expected version...` We use [nvm](https://github.com/nvm-sh/nvm) as node's version manage, check that the right version of node is installed (specified in `.nvmrc`) and run `nvm use <version>`.
69
- * Make sure that all the packages are install by running `yarn install`
69
+ * Make sure that all the packages are installed by running `yarn install`
@@ -1,5 +1,2 @@
1
- //= link_tree ../images
2
- //= link_directory ../regex .rb
3
1
  //= link application.js
4
- //= link application.css
5
- //= link stats.js
2
+ //= link application.css
@@ -1,3 +1,4 @@
1
+
1
2
  // This is a manifest file that'll be compiled into application.js, which will include all the files
2
3
  // listed below.
3
4
  //
@@ -10,10 +11,4 @@
10
11
  // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
12
  // about supported directives.
12
13
  //
13
- //= require jquery
14
- //= require jquery-scrolltofixed
15
- //= require clipboard
16
- //= require underscore
17
- //= require gmaps/google
18
- //= require javascripts/nexmo-oas-renderer
19
- //= require mermaid
14
+ //= require javascripts/nexmo-oas-renderer
@@ -1 +1 @@
1
- //= require stylesheets/nexmo-oas-renderer
1
+ //= require stylesheets/nexmo-oas-renderer
@@ -1,6 +1,5 @@
1
1
  class DashboardController < ApplicationController
2
2
  before_action :authenticate_admin!
3
- before_action :set_additional_scripts
4
3
 
5
4
  def stats
6
5
  @feedbacks = Feedback::Feedback.created_between(created_after, created_before)
@@ -104,10 +103,6 @@ class DashboardController < ApplicationController
104
103
 
105
104
  private
106
105
 
107
- def set_additional_scripts
108
- @additional_scripts = ['stats']
109
- end
110
-
111
106
  def ignore_languages
112
107
  return params[:ignore].split(',') if params[:ignore].present?
113
108
 
@@ -8,19 +8,19 @@ class JobsController < ApplicationController
8
8
  if params['ref'] == 'refs/heads/master'
9
9
  url = "https://api.travis-ci.org/repo/#{ENV['TRAVIS_REPO_ID']}/requests"
10
10
  RestClient.post(url, {
11
- "request": {
12
- "branch": 'master',
13
- "config": {
14
- "script": 'bundle exec rake diff:execute',
15
- "env": {
16
- "SSH_KEY_REQUIRED": true,
11
+ request: {
12
+ branch: 'master',
13
+ config: {
14
+ script: 'bundle exec rake diff:execute',
15
+ env: {
16
+ SSH_KEY_REQUIRED: true,
17
17
  },
18
18
  },
19
19
  },
20
20
  }.to_json, {
21
21
  content_type: :json,
22
22
  accept: :json,
23
- 'Authorization': "token #{ENV['TRAVIS_TOKEN']}",
23
+ Authorization: "token #{ENV['TRAVIS_TOKEN']}",
24
24
  'Travis-API-Version': '3',
25
25
  })
26
26
 
@@ -45,6 +45,8 @@ class StaticController < ApplicationController
45
45
  migrate_tropo
46
46
  end
47
47
 
48
+ @frontmatter = @landing_config
49
+ @document_title = @landing_config['title']
48
50
  @navigation = yaml_name.to_sym
49
51
  render layout: 'landing'
50
52
  end
@@ -113,7 +115,9 @@ class StaticController < ApplicationController
113
115
  end
114
116
 
115
117
  def robots
116
- render 'robots.txt'
118
+ respond_to do |format|
119
+ format.any { render plain: 'robots', layout: false, content_type: 'text/plain' }
120
+ end
117
121
  end
118
122
 
119
123
  def team
@@ -143,19 +147,6 @@ class StaticController < ApplicationController
143
147
  end
144
148
  end
145
149
 
146
- def spotlight
147
- response = RestClient.post(
148
- 'https://hooks.zapier.com/hooks/catch/1936493/oyzjr4i/',
149
- params.permit(:name, :email_address, :background, :outline, :previous_content).to_h
150
- )
151
-
152
- if response.code == 200
153
- head :ok
154
- else
155
- head :unprocessable_entity
156
- end
157
- end
158
-
159
150
  def blog_cookie
160
151
  # This is the first touch time so we only want to set it if it's not already set
161
152
  set_utm_cookie('ft', Time.now.getutc.to_i) unless cookies[:ft]
@@ -26,6 +26,8 @@ module Feedback
26
26
  end
27
27
 
28
28
  def notify
29
+ OrbitFeedbackNotifier.call(self) if !owner.nil? && owner.email.present?
30
+
29
31
  return unless ENV['SLACK_WEBHOOK']
30
32
 
31
33
  FeedbackSlackNotifier.call(self)
@@ -26,11 +26,15 @@ class Head
26
26
  end
27
27
 
28
28
  def title
29
- @title ||= config.fetch('title') do
29
+ @title ||= title_from_frontmatter || config.fetch('title') do
30
30
  raise "You must provide a 'title' parameter in header_meta.yml"
31
31
  end
32
32
  end
33
33
 
34
+ def title_from_frontmatter
35
+ @frontmatter && (@frontmatter['meta_title'] || @frontmatter['title'])
36
+ end
37
+
34
38
  def description
35
39
  @description ||= Description.new(config: config, frontmatter: frontmatter).description
36
40
  end
@@ -4,16 +4,19 @@ class ImprovePagePresenter
4
4
  end
5
5
 
6
6
  def github_url
7
- @github_url ||= "https://github.com/#{docs_repo}/blob/#{ENV.fetch('branch', 'master')}/#{path_to_url}"
7
+ @github_url ||= "https://github.com/#{docs_repo}/blob/#{ENV.fetch('branch', 'main')}/#{path_to_url}"
8
8
  end
9
9
 
10
- private
11
-
12
- def path_to_url
13
- @document_path&.gsub("#{Rails.configuration.docs_base_path}/", '')
10
+ def docs_repo
11
+ @docs_repo ||= begin
12
+ path_to_url.start_with?('lib/nexmo_developer/app/') ? 'nexmo/station' : YAML.safe_load(File.open("#{Rails.configuration.docs_base_path}/config/business_info.yml"))['docs_repo']
13
+ end
14
14
  end
15
15
 
16
- def docs_repo
17
- @docs_repo ||= YAML.safe_load(File.open("#{Rails.configuration.docs_base_path}/config/business_info.yml"))['docs_repo']
16
+ def path_to_url
17
+ @path_to_url ||= begin
18
+ @document_path&.gsub!("#{Rails.configuration.docs_base_path}/", '')
19
+ @document_path.start_with?('app/views') ? @document_path.prepend('lib/nexmo_developer/') : @document_path
20
+ end
18
21
  end
19
22
  end
@@ -0,0 +1,53 @@
1
+ class OrbitFeedbackNotifier
2
+ CONFIG = YAML.load_file("#{Rails.configuration.docs_base_path}/config/business_info.yml")
3
+
4
+ def self.call(feedback)
5
+ new(feedback).post!
6
+ end
7
+
8
+ def initialize(feedback)
9
+ @feedback = feedback
10
+ end
11
+
12
+ def params
13
+ @params ||= {
14
+ id: @feedback.id,
15
+ email: @feedback.owner.email,
16
+ resource: "Offered #{@feedback.sentiment} feedback on #{@feedback.resource.uri}",
17
+ }
18
+ end
19
+
20
+ def uri
21
+ @uri ||= URI("https://app.orbit.love/api/v1/#{ENV['ORBIT_WORKSPACE_ID']}/activities")
22
+ end
23
+
24
+ def post!
25
+ return unless ENV['ORBIT_WORKSPACE_ID']
26
+
27
+ http = Net::HTTP.new(uri.host, uri.port)
28
+ http.use_ssl = true
29
+ req = Net::HTTP::Post.new(uri)
30
+ req['Accept'] = 'application/json'
31
+ req['Content-Type'] = 'application/json'
32
+ req['Authorization'] = "Bearer #{ENV['ORBIT_API_KEY']}"
33
+
34
+ req.body = {
35
+ activity: {
36
+ activity_type: 'adp:feedback',
37
+ key: "adp-feedback-#{params[:id]}",
38
+ title: 'Offered feedback on ADP',
39
+ description: params[:resource],
40
+ occurred_at: Time.zone.now.iso8601,
41
+ },
42
+ identity: {
43
+ source: 'email',
44
+ source_host: CONFIG['base_url'],
45
+ email: params[:email],
46
+ },
47
+ }
48
+
49
+ req.body = req.body.to_json
50
+
51
+ http.request(req)
52
+ end
53
+ end
@@ -13,7 +13,7 @@ module Translator
13
13
  end
14
14
 
15
15
  def files
16
- @files ||= `(git fetch origin master:master) && (git log --since="#{@days} days" --name-only --oneline --diff-filter=ACM --pretty=format: master #{Rails.configuration.docs_base_path}/_documentation/en #{Rails.configuration.docs_base_path}/_tutorials/en #{Rails.configuration.docs_base_path}/_use_cases/en) | uniq | awk 'NF'`.split("\n")
16
+ @files ||= `(git fetch origin main:main) && (git log --since="#{@days} days" --name-only --oneline --diff-filter=ACM --pretty=format: main #{Rails.configuration.docs_base_path}/_documentation/en #{Rails.configuration.docs_base_path}/_tutorials/en #{Rails.configuration.docs_base_path}/_use_cases/en) | uniq | awk 'NF'`.split("\n")
17
17
  end
18
18
 
19
19
  def process_files(files)
@@ -18,7 +18,12 @@ module Translator
18
18
  def uri
19
19
  @uri ||= begin
20
20
  uri = URI("https://api.smartling.com/files-api/v2/projects/#{@project_id}/locales/#{@locale_id}/file")
21
- uri.query = URI.encode_www_form({ 'fileUri' => @file_uri, 'retrievalType' => 'published' })
21
+ uri.query = URI.encode_www_form(
22
+ {
23
+ 'fileUri' => @file_uri,
24
+ 'retrievalType' => 'published',
25
+ }
26
+ )
22
27
  uri
23
28
  end
24
29
  end
@@ -31,7 +31,13 @@ module Translator
31
31
  end
32
32
 
33
33
  def return_value
34
- @return_value ||= response_body['response']['data']['items'].map { |item| item['localeId'] }
34
+ @return_value ||= begin
35
+ total_word_count = response_body['response']['data']['totalWordCount']
36
+ total_string_count = response_body['response']['data']['totalStringCount']
37
+ response_body['response']['data']['items'].map do |item|
38
+ item['localeId'] if total_word_count == item['completedWordCount'] && total_string_count == item['completedStringCount']
39
+ end.compact
40
+ end
35
41
  end
36
42
 
37
43
  def to_s
@@ -35,7 +35,7 @@ module Translator
35
35
  dir_path = pathname.dirname.to_s == '.' ? '' : "/#{pathname.dirname}"
36
36
  "#{Rails.configuration.docs_base_path}/config/tutorials/#{locale}#{dir_path}"
37
37
  elsif filename.starts_with? '_tutorials'
38
- pathname = Pathname.new(filename.gsub("_tutorials/#{I18n.default_locale}/", ''))
38
+ pathname = Pathname.new(filename.gsub('_tutorials/', ''))
39
39
  dir_path = pathname.dirname.to_s == '.' ? '' : "/#{pathname.dirname}"
40
40
  "#{Rails.configuration.docs_base_path}/_tutorials/#{locale}#{dir_path}"
41
41
  else
@@ -544,13 +544,3 @@ The `warning_callout` content block provides an element to render a warning mess
544
544
  content: # Warning message goes here
545
545
 
546
546
  ```
547
-
548
- ### Write for Nexmo
549
-
550
- The `write_for_nexmo` content block will provide a call to action element to Write for Nexmo with a Developer Spotlight graphic on the left-hand side and text advertising the Write for Nexmo program on the left-hand side.
551
-
552
- ```yaml
553
-
554
- - type: write_for_nexmo
555
-
556
- ```
@@ -126,6 +126,25 @@ They auto-magically color when you use verbs like [POST] or [DELETE]
126
126
  |
127
127
  | Nullam id dolor id nibh ultricies vehicula ut id elit. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
128
128
 
129
+ ````
130
+ | ### Click me
131
+ |
132
+ | Here is some hidden content.
133
+ |
134
+ | Markdown _still_ works `here`!
135
+ |
136
+ | Nullam id dolor id nibh ultricies vehicula ut id elit. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
137
+ ````
138
+
139
+ | ### Alpha
140
+ |
141
+ | Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Donec id elit non mi porta gravida at eget metus. Sed posuere consectetur est at lobortis. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ullamcorper nulla non metus auctor fringilla.
142
+ |
143
+ | Donec id elit non mi porta gravida at eget metus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Nulla vitae elit libero, a pharetra augue. Donec sed odio dui. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras mattis consectetur purus sit amet fermentum.
144
+ |
145
+ | Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Donec id elit non mi porta gravida at eget metus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Aenean lacinia bibendum nulla sed consectetur. Nullam quis risus eget urna mollis ornare vel eu leo.
146
+
147
+ ````
129
148
  | ### Alpha
130
149
  |
131
150
  | Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Donec id elit non mi porta gravida at eget metus. Sed posuere consectetur est at lobortis. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ullamcorper nulla non metus auctor fringilla.
@@ -133,15 +152,24 @@ They auto-magically color when you use verbs like [POST] or [DELETE]
133
152
  | Donec id elit non mi porta gravida at eget metus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Nulla vitae elit libero, a pharetra augue. Donec sed odio dui. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras mattis consectetur purus sit amet fermentum.
134
153
  |
135
154
  | Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Donec id elit non mi porta gravida at eget metus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Aenean lacinia bibendum nulla sed consectetur. Nullam quis risus eget urna mollis ornare vel eu leo.
155
+ ````
136
156
 
137
157
  **Tooltips (custom plugin)**
138
158
 
139
159
  Find out ^[more](Tooltips are useful for when you have more information to convey, but don't want to break context.).
140
160
 
161
+ ````
162
+ Find out ^[more](Tooltips are useful for when you have more information to convey, but don't want to break context.).
163
+ ````
164
+
141
165
  ## Images
142
166
 
143
167
  ![Please always add alt-text](https://media.giphy.com/media/pDTLSpqNvNxlu/giphy.gif)
144
168
 
169
+ ````
170
+ ![Please always add alt-text](https://media.giphy.com/media/pDTLSpqNvNxlu/giphy.gif)
171
+ ````
172
+
145
173
  > Images should be used sparingly, try to avoid using screenshots that might go out of date.
146
174
  >
147
175
  > Also... Please ALWAYS write descriptive alt text.
@@ -183,8 +211,6 @@ See our detailed [code examples guide](/contribute/guides/code-examples) for adv
183
211
  ## Tables
184
212
 
185
213
  > Pipes should only be between cells. Two hyphens `--` should be used to 'underline' the headings.
186
- >
187
- > You'll have to view the `markdown-guide.md` source to see how since showing you the syntax would result in it being processed.
188
214
 
189
215
  | Key | Description |
190
216
  | ------------ | ------------------------------------------------------------------------------------------ |
@@ -192,6 +218,14 @@ See our detailed [code examples guide](/contribute/guides/code-examples) for adv
192
218
  | `API_KEY` | You can find this in your [account overview](https://dashboard.nexmo.com/account-overview) |
193
219
  | `API_SECRET` | You can find this in your [account overview](https://dashboard.nexmo.com/account-overview) |
194
220
 
221
+ ````
222
+ | Key | Description |
223
+ | ------------ | ------------------------------------------------------------------------------------------ |
224
+ | `TO_NUMBER` | The number you are sending the SMS to |
225
+ | `API_KEY` | You can find this in your [account overview](https://dashboard.nexmo.com/account-overview) |
226
+ | `API_SECRET` | You can find this in your [account overview](https://dashboard.nexmo.com/account-overview) |
227
+ ````
228
+
195
229
  ## Tabbed Content (custom plugin)
196
230
 
197
231
  To use the tabbed content block, add a section like this to your markdown to point out where the directory holding the examples is:
@@ -325,44 +359,6 @@ If you are adding support for a changed header this would normally go above the
325
359
 
326
360
  [Go to the anchor](#anchor-example). I've placed at the top of this document.
327
361
 
328
- ## Screenshots
329
-
330
- Webpage screenshots can be scripted so that they only require sourcing once. Define a screenshot as such:
331
-
332
- ````
333
- ```screenshot
334
- script: app/screenshots/webhook-url-for-delivery-receipt.js
335
- ```
336
- ````
337
-
338
- Run the following command:
339
-
340
- ```
341
- $ rake screenshots:new
342
- ```
343
-
344
- This changes the original source document to add an `image` value pointing to the screenshot:
345
-
346
- ````
347
- ```screenshot
348
- script: app/screenshots/webhook-url-for-delivery-receipt.js
349
- image: public/assets/screenshots/da5f952d465355c19eb888fa1049844b31e090c2.png
350
- ```
351
- ````
352
-
353
- You can also update all examples by running the following command:
354
-
355
- ```
356
- $ rake screenshots:all
357
- ```
358
-
359
- Here is the example of the final rendered output:
360
-
361
- ```screenshot
362
- script: app/screenshots/webhook-url-for-delivery-receipt.js
363
- image: public/assets/screenshots/da5f952d465355c19eb888fa1049844b31e090c2.png
364
- ```
365
-
366
362
  ## Audio (custom plugin)
367
363
 
368
364
  The HTML `<audio>` element can be utilised in Markdown with the following syntax:
@@ -145,7 +145,6 @@ Frontmatter | No | [Implicit] | Strips frontmatter from documents
145
145
  PHPInliner | No | [Implicit] | Fixes a quirk with our code parser that requires PHP code to have `<?php` at the start. This filter adds an option onto PHP code examples that makes this not required.
146
146
  InlineEscape | No | [Extended] | Allows for escaping of inline code where normally the internals would be processes by the markdown. For example this isn't turned into a ``[label]`` when surrounded by two backticks.
147
147
  BlockEscape | No | [Extended] | Allows for escaping of code fences where normally the internals would be processes by the markdown.
148
- Screenshot | No | [Plugin] | Allows for screenshots be put into documentation that are captured by a headless browser so they can be easily refreshed.
149
148
  Anchor | No | [Extended] | Useful for when a title changes, an explicit anchor can be added and renders a non-visible anchor link to the same content.
150
149
  Audio | No | [Extended] | Used to embed audio examples using the `<audio>` element.
151
150
  Tooltip | No | [Extended] | Allows for ^[Toolips](Hello world!) to be added with a markdown-style syntax.