nexmo_markdown_renderer 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nexmo_markdown_renderer/filters/relative_link_filter.rb +21 -0
- data/lib/nexmo_markdown_renderer/markdown_renderer.rb +4 -3
- data/lib/nexmo_markdown_renderer/models/concept.rb +17 -17
- data/lib/nexmo_markdown_renderer/models/tutorial.rb +30 -30
- data/lib/nexmo_markdown_renderer/models/use_case.rb +19 -15
- data/lib/nexmo_markdown_renderer/services/doc_finder/doc.rb +12 -0
- data/lib/nexmo_markdown_renderer/services/doc_finder.rb +30 -24
- data/lib/nexmo_markdown_renderer.rb +2 -1
- data/lib/version.rb +1 -1
- metadata +19 -5
- data/lib/nexmo_markdown_renderer/views/use_case/index.html.erb +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf72d97b82f7c671efe8a44e8699732332a3e59c3cbb7df3b6f87ec37a790a5d
|
4
|
+
data.tar.gz: 91763b45e66bf134adb6c4297b0967625a355ff0054686bfb6b70fb680f0e7f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b60124cae98030eea13ec9498733c234dee46cf704238ee3252d70743a2a96e705983100c66c97a6d0ddad7fa4f3046b37aea5912805c32bd8396016efe8698
|
7
|
+
data.tar.gz: '0458dfbbaf465ea60949c8e359d7db9bc3df2acbd9a2c5eba484015ce179c6225e4e647810508c38fbf578674eb31c630f92512437f05e66fd22e7d9410ff0d3'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Nexmo
|
2
|
+
module Markdown
|
3
|
+
class RelativeLinkFilter < Banzai::Filter
|
4
|
+
def call(input)
|
5
|
+
@input = input
|
6
|
+
|
7
|
+
document.css('a[href^="/"]').each_with_index do |link, _index|
|
8
|
+
link[:href] = "/#{options[:locale]}#{link[:href]}" if options[:locale]
|
9
|
+
end
|
10
|
+
|
11
|
+
document.to_html
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def document
|
17
|
+
@document ||= Nokogiri::HTML::DocumentFragment.parse(@input)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -30,18 +30,19 @@ module Nexmo
|
|
30
30
|
LanguageFilter,
|
31
31
|
ColumnsFilter,
|
32
32
|
MarkdownFilter.new(options),
|
33
|
-
|
33
|
+
|
34
34
|
# As HTML
|
35
35
|
HeadingFilter,
|
36
36
|
LabelFilter.new(options),
|
37
37
|
BreakFilter,
|
38
38
|
UnfreezeFilter,
|
39
39
|
IconFilter,
|
40
|
-
ExternalLinkFilter
|
40
|
+
ExternalLinkFilter,
|
41
|
+
RelativeLinkFilter.new(options)
|
41
42
|
)
|
42
43
|
end
|
43
44
|
|
44
45
|
|
45
46
|
end
|
46
47
|
end
|
47
|
-
end
|
48
|
+
end
|
@@ -2,16 +2,16 @@ module Nexmo
|
|
2
2
|
module Markdown
|
3
3
|
class Concept
|
4
4
|
include ActiveModel::Model
|
5
|
-
|
5
|
+
|
6
6
|
ORIGIN = "#{ENV['DOCS_BASE_PATH']}/_documentation".freeze
|
7
|
-
|
7
|
+
|
8
8
|
FILES = [
|
9
9
|
Dir.glob("#{ORIGIN}/#{::I18n.default_locale}/**/guides/**/*.md"),
|
10
10
|
Dir.glob("#{ORIGIN}/#{::I18n.default_locale}/**/concepts/**/*.md"),
|
11
11
|
].flatten
|
12
|
-
|
12
|
+
|
13
13
|
attr_accessor :title, :product, :description, :navigation_weight, :document_path, :url, :ignore_in_list
|
14
|
-
|
14
|
+
|
15
15
|
def self.by_name(names, language)
|
16
16
|
matches = all(language).select do |block|
|
17
17
|
concept = "#{block.product}/#{block.filename}"
|
@@ -19,28 +19,28 @@ module Nexmo
|
|
19
19
|
names.delete(concept) if match
|
20
20
|
match
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
raise "Could not find concepts: #{names.join(', ')}" unless names.empty?
|
24
24
|
matches
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def self.by_product(product, language)
|
28
28
|
all(language).select do |block|
|
29
29
|
block.product == product
|
30
30
|
end
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def filename
|
34
34
|
Pathname(document_path).basename.to_s.gsub('.md', '')
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
def self.all(language)
|
38
38
|
blocks = files(language).map do |document_path|
|
39
39
|
document = File.read(document_path)
|
40
40
|
product = extract_product(document_path)
|
41
|
-
|
41
|
+
|
42
42
|
frontmatter = YAML.safe_load(document)
|
43
|
-
|
43
|
+
|
44
44
|
Nexmo::Markdown::Concept.new({
|
45
45
|
title: frontmatter['title'],
|
46
46
|
description: frontmatter['description'],
|
@@ -51,31 +51,31 @@ module Nexmo
|
|
51
51
|
url: generate_url(document_path, language),
|
52
52
|
})
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
blocks.sort_by(&:navigation_weight)
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
def self.generate_url(path, language)
|
59
59
|
'/' + path.gsub("#{ORIGIN}/#{language}/", '').gsub('.md', '')
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
def self.extract_product(path)
|
63
63
|
# Remove the prefix
|
64
64
|
path = path.gsub!(%r{#{ORIGIN}\/[a-z]{2}\/}, '')
|
65
|
-
|
65
|
+
|
66
66
|
# Each file is in the form guides/<title>.md, so let's remove the last two segments
|
67
67
|
parts = path.split('/')
|
68
68
|
parts = parts[0...-2]
|
69
|
-
|
69
|
+
|
70
70
|
# What's left once we remove the start and end of the path is our product name. This could be any number
|
71
71
|
# of parts, but it's generally 1-2
|
72
72
|
parts.join('/')
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
def self.files(language)
|
76
76
|
FILES.each_with_object([]) do |file, array|
|
77
77
|
document = file.gsub("#{ORIGIN}/#{::I18n.default_locale}/", '')
|
78
|
-
array << Nexmo::Markdown::DocFinder.find(root: ORIGIN, document: document, language: language)
|
78
|
+
array << Nexmo::Markdown::DocFinder.find(root: ORIGIN, document: document, language: language).path
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
@@ -3,57 +3,57 @@ module Nexmo
|
|
3
3
|
class Tutorial
|
4
4
|
include ActiveModel::Model
|
5
5
|
attr_accessor :raw, :name, :current_step, :current_product, :title, :description, :products, :subtasks, :prerequisites
|
6
|
-
|
6
|
+
|
7
7
|
def content_for(step_name)
|
8
8
|
if ['introduction', 'conclusion'].include? step_name
|
9
9
|
raise "Invalid step: #{step_name}" unless raw[step_name]
|
10
|
-
|
10
|
+
|
11
11
|
return raw[step_name]['content']
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
path = Nexmo::Markdown::DocFinder.find(
|
15
15
|
root: self.class.task_content_path,
|
16
16
|
document: step_name,
|
17
17
|
language: ::I18n.locale
|
18
|
-
)
|
19
|
-
|
18
|
+
).path
|
19
|
+
|
20
20
|
File.read(path)
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def first_step
|
24
24
|
subtasks.first['path']
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def prerequisite?
|
28
28
|
prerequisites.pluck('path').include?(@current_step)
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
def next_step
|
32
32
|
current_task_index = subtasks.pluck('path').index(@current_step)
|
33
33
|
return nil unless current_task_index
|
34
|
-
|
34
|
+
|
35
35
|
subtasks[current_task_index + 1]
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def previous_step
|
39
39
|
current_task_index = subtasks.pluck('path').index(@current_step)
|
40
40
|
return nil unless current_task_index
|
41
41
|
return nil if current_task_index <= 0
|
42
|
-
|
42
|
+
|
43
43
|
subtasks[current_task_index - 1]
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
def self.load(name, current_step, current_product = nil)
|
47
47
|
document_path = Nexmo::Markdown::DocFinder.find(
|
48
48
|
root: 'config/tutorials',
|
49
49
|
document: name,
|
50
50
|
language: ::I18n.default_locale,
|
51
51
|
format: 'yml'
|
52
|
-
)
|
52
|
+
).path
|
53
53
|
config = YAML.safe_load(File.read(document_path))
|
54
54
|
current_product ||= config['products'].first
|
55
|
-
|
56
|
-
|
55
|
+
|
56
|
+
new({
|
57
57
|
raw: config,
|
58
58
|
name: name,
|
59
59
|
current_step: current_step,
|
@@ -65,18 +65,18 @@ module Nexmo
|
|
65
65
|
subtasks: load_subtasks(config['introduction'], config['prerequisites'], config['tasks'], config['conclusion'], current_step),
|
66
66
|
})
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
def self.load_prerequisites(prerequisites, current_step)
|
70
70
|
return [] unless prerequisites
|
71
|
-
|
71
|
+
|
72
72
|
prerequisites.map do |t|
|
73
73
|
t_path = Nexmo::Markdown::DocFinder.find(
|
74
74
|
root: task_content_path,
|
75
75
|
document: t,
|
76
76
|
language: ::I18n.locale
|
77
|
-
)
|
77
|
+
).path
|
78
78
|
raise "Prerequisite not found: #{t}" unless File.exist? t_path
|
79
|
-
|
79
|
+
|
80
80
|
content = File.read(t_path)
|
81
81
|
prereq = YAML.safe_load(content)
|
82
82
|
{
|
@@ -88,18 +88,18 @@ module Nexmo
|
|
88
88
|
}
|
89
89
|
end
|
90
90
|
end
|
91
|
-
|
91
|
+
|
92
92
|
def self.load_subtasks(introduction, prerequisites, tasks, conclusion, current_step)
|
93
93
|
tasks ||= []
|
94
|
-
|
94
|
+
|
95
95
|
tasks = tasks.map do |t|
|
96
96
|
t_path = Nexmo::Markdown::DocFinder.find(
|
97
97
|
root: task_content_path,
|
98
98
|
document: t,
|
99
99
|
language: ::I18n.locale
|
100
|
-
)
|
100
|
+
).path
|
101
101
|
raise "Subtask not found: #{t}" unless File.exist? t_path
|
102
|
-
|
102
|
+
|
103
103
|
subtask_config = YAML.safe_load(File.read(t_path))
|
104
104
|
{
|
105
105
|
'path' => t,
|
@@ -108,7 +108,7 @@ module Nexmo
|
|
108
108
|
'is_active' => t == current_step,
|
109
109
|
}
|
110
110
|
end
|
111
|
-
|
111
|
+
|
112
112
|
if prerequisites
|
113
113
|
tasks.unshift({
|
114
114
|
'path' => 'prerequisites',
|
@@ -117,7 +117,7 @@ module Nexmo
|
|
117
117
|
'is_active' => current_step == 'prerequisites',
|
118
118
|
})
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
if introduction
|
122
122
|
tasks.unshift({
|
123
123
|
'path' => 'introduction',
|
@@ -126,7 +126,7 @@ module Nexmo
|
|
126
126
|
'is_active' => current_step == 'introduction',
|
127
127
|
})
|
128
128
|
end
|
129
|
-
|
129
|
+
|
130
130
|
if conclusion
|
131
131
|
tasks.push({
|
132
132
|
'path' => 'conclusion',
|
@@ -135,14 +135,14 @@ module Nexmo
|
|
135
135
|
'is_active' => current_step == 'conclusion',
|
136
136
|
})
|
137
137
|
end
|
138
|
-
|
138
|
+
|
139
139
|
tasks
|
140
140
|
end
|
141
|
-
|
141
|
+
|
142
142
|
def self.task_content_path
|
143
143
|
"#{ENV['DOCS_BASE_PATH']}/_tutorials"
|
144
144
|
end
|
145
145
|
end
|
146
|
-
|
146
|
+
|
147
147
|
end
|
148
|
-
end
|
148
|
+
end
|
@@ -3,25 +3,29 @@ module Nexmo
|
|
3
3
|
class UseCase
|
4
4
|
include ActiveModel::Model
|
5
5
|
attr_accessor :title, :description, :external_link, :products, :document_path, :languages, :root
|
6
|
-
|
6
|
+
|
7
7
|
def body
|
8
8
|
File.read(document_path)
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
|
+
def relative_path
|
12
|
+
document_path.relative_path_from(self.class.origin).sub("#{::I18n.locale}/", '').to_s.gsub('.md', '')
|
13
|
+
end
|
14
|
+
|
11
15
|
def path
|
12
16
|
return external_link if external_link
|
13
|
-
|
14
|
-
"/use-cases/#{
|
17
|
+
|
18
|
+
"/use-cases/#{relative_path}"
|
15
19
|
end
|
16
|
-
|
20
|
+
|
17
21
|
def subtitle
|
18
22
|
normalized_products = products.map do |product|
|
19
23
|
normalise_product_title(product)
|
20
24
|
end
|
21
|
-
|
25
|
+
|
22
26
|
normalized_products.sort.to_sentence
|
23
27
|
end
|
24
|
-
|
28
|
+
|
25
29
|
def normalise_product_title(product)
|
26
30
|
return 'SMS' if product == 'messaging/sms'
|
27
31
|
return 'Voice' if product == 'voice/voice-api'
|
@@ -32,33 +36,33 @@ module Nexmo
|
|
32
36
|
return 'Subaccounts' if product == 'account/subaccounts'
|
33
37
|
product.camelcase
|
34
38
|
end
|
35
|
-
|
39
|
+
|
36
40
|
def self.by_product(product, use_cases = [])
|
37
41
|
use_cases = all if use_cases.empty?
|
38
42
|
use_cases.select do |use_case|
|
39
43
|
use_case.products.include? product
|
40
44
|
end
|
41
45
|
end
|
42
|
-
|
46
|
+
|
43
47
|
def self.by_language(language, use_cases = [])
|
44
48
|
language = language.downcase
|
45
49
|
use_cases = all if use_cases.empty?
|
46
|
-
|
50
|
+
|
47
51
|
use_cases.select do |use_case|
|
48
52
|
use_case.languages.map(&:downcase).include? language
|
49
53
|
end
|
50
54
|
end
|
51
|
-
|
55
|
+
|
52
56
|
def self.origin
|
53
57
|
Pathname.new("#{ENV['DOCS_BASE_PATH']}/_use_cases")
|
54
58
|
end
|
55
|
-
|
59
|
+
|
56
60
|
def self.all
|
57
61
|
files.map do |document_path|
|
58
62
|
document_path = Pathname.new(document_path)
|
59
63
|
document = File.read(document_path)
|
60
64
|
frontmatter = YAML.safe_load(document)
|
61
|
-
|
65
|
+
|
62
66
|
Nexmo::Markdown::UseCase.new({
|
63
67
|
title: frontmatter['title'],
|
64
68
|
description: frontmatter['description'],
|
@@ -70,9 +74,9 @@ module Nexmo
|
|
70
74
|
})
|
71
75
|
end
|
72
76
|
end
|
73
|
-
|
77
|
+
|
74
78
|
private
|
75
|
-
|
79
|
+
|
76
80
|
private_class_method def self.files
|
77
81
|
Dir.glob("#{origin}/**/*.md")
|
78
82
|
end
|
@@ -2,14 +2,14 @@ module Nexmo
|
|
2
2
|
module Markdown
|
3
3
|
class DocFinder
|
4
4
|
class MissingDoc < StandardError; end
|
5
|
-
|
5
|
+
|
6
6
|
EXCLUSIONS = ['.', '..', ::I18n.default_locale.to_s].freeze
|
7
|
-
|
7
|
+
|
8
8
|
class << self
|
9
9
|
mattr_accessor :paths
|
10
10
|
mattr_accessor :dictionary
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
# rubocop:disable Metrics/ParameterLists
|
14
14
|
def self.find(root:, document:, language: nil, product: nil, code_language: nil, format: 'md', strip_root_and_language: false)
|
15
15
|
if strip_root_and_language
|
@@ -19,7 +19,7 @@ module Nexmo
|
|
19
19
|
if code_language.present?
|
20
20
|
linkable_code_language(
|
21
21
|
root: root,
|
22
|
-
language: language,
|
22
|
+
language: language.to_s,
|
23
23
|
product: product,
|
24
24
|
document: document,
|
25
25
|
code_language: code_language,
|
@@ -28,7 +28,7 @@ module Nexmo
|
|
28
28
|
else
|
29
29
|
non_linkable(
|
30
30
|
root: root,
|
31
|
-
language: language,
|
31
|
+
language: language.to_s,
|
32
32
|
product: product,
|
33
33
|
document: document,
|
34
34
|
format: format
|
@@ -38,28 +38,34 @@ module Nexmo
|
|
38
38
|
raise MissingDoc, e.message
|
39
39
|
end
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
def self.linkable_code_language(root:, language:, document:, product: nil, code_language: nil, format: nil)
|
43
43
|
key = [
|
44
44
|
build_key(root: root, product: product, document: "#{document}/#{code_language}", format: format),
|
45
45
|
build_key(root: root, product: product, document: document, format: format),
|
46
46
|
].select { |k| dictionary.key?(k) }.first
|
47
|
-
|
48
|
-
|
49
|
-
build_doc_path(root, key, available_language)
|
47
|
+
|
48
|
+
build_doc(root: root, language: language, key: key)
|
50
49
|
end
|
51
|
-
|
50
|
+
|
52
51
|
def self.non_linkable(root:, language:, document:, product: nil, format: nil)
|
53
52
|
key = build_key(root: root, product: product, document: document, format: format)
|
53
|
+
|
54
|
+
build_doc(root: root, language: language, key: key)
|
55
|
+
end
|
56
|
+
# rubocop:enable Metrics/ParameterLists
|
57
|
+
|
58
|
+
def self.build_doc(root:, language:, key:)
|
54
59
|
if root.starts_with?('app/views')
|
55
|
-
dictionary.fetch(key) && key
|
60
|
+
DocFinder::Doc.new(path: dictionary.fetch(key) && key, available_languages: ['en'])
|
56
61
|
else
|
57
|
-
|
58
|
-
|
62
|
+
available_languages = dictionary.fetch(key)
|
63
|
+
available_language = available_languages.fetch(language, ::I18n.default_locale.to_s)
|
64
|
+
|
65
|
+
DocFinder::Doc.new(path: build_doc_path(root, key, available_language), available_languages: available_languages.keys)
|
59
66
|
end
|
60
67
|
end
|
61
|
-
|
62
|
-
|
68
|
+
|
63
69
|
def self.build_key(root:, document:, product: nil, format: nil)
|
64
70
|
path = if Pathname.new(document).extname.blank?
|
65
71
|
"#{root}/#{product}/#{document}.#{format}"
|
@@ -68,21 +74,21 @@ module Nexmo
|
|
68
74
|
end
|
69
75
|
path.gsub(%r{\/\/\/|\/\/}, '/')
|
70
76
|
end
|
71
|
-
|
77
|
+
|
72
78
|
def self.build_doc_path(root, doc, language)
|
73
79
|
doc.gsub(root, "#{root}/#{language}")
|
74
80
|
end
|
75
|
-
|
81
|
+
|
76
82
|
def self.configure
|
77
83
|
self.paths = []
|
78
84
|
self.dictionary = Hash.new { |hash, key| hash[key] = {} }
|
79
|
-
|
85
|
+
|
80
86
|
yield(self)
|
81
|
-
|
87
|
+
|
82
88
|
load_english
|
83
89
|
load_languages
|
84
90
|
end
|
85
|
-
|
91
|
+
|
86
92
|
def self.load_english
|
87
93
|
paths.each do |path|
|
88
94
|
if path.starts_with?('app/views')
|
@@ -98,7 +104,7 @@ module Nexmo
|
|
98
104
|
end
|
99
105
|
end
|
100
106
|
end
|
101
|
-
|
107
|
+
|
102
108
|
def self.load_languages
|
103
109
|
paths.each do |path|
|
104
110
|
Dir.foreach(path).reject { |d| EXCLUSIONS.include? d }.each do |language|
|
@@ -110,10 +116,10 @@ module Nexmo
|
|
110
116
|
end
|
111
117
|
end
|
112
118
|
end
|
113
|
-
|
119
|
+
|
114
120
|
def self.strip_root_and_language(root:, language:, document:)
|
115
121
|
document.sub(%r{#{root}\/}, '').sub(%r{#{language}\/}, '')
|
116
122
|
end
|
117
|
-
end
|
123
|
+
end
|
118
124
|
end
|
119
|
-
end
|
125
|
+
end
|
@@ -21,7 +21,8 @@ require_relative 'nexmo_markdown_renderer/services/code_snippet_renderer/php'
|
|
21
21
|
require_relative 'nexmo_markdown_renderer/services/code_snippet_renderer/python'
|
22
22
|
require_relative 'nexmo_markdown_renderer/services/code_snippet_renderer/ruby'
|
23
23
|
require_relative 'nexmo_markdown_renderer/services/code_snippet_renderer/swift'
|
24
|
-
|
24
|
+
require_relative 'nexmo_markdown_renderer/services/doc_finder'
|
25
|
+
require_relative 'nexmo_markdown_renderer/services/doc_finder/doc'
|
25
26
|
Dir[File.join(__dir__, 'nexmo_markdown_renderer/models', '*.rb')].each { |file| require_relative file }
|
26
27
|
Dir[File.join(__dir__, 'nexmo_markdown_renderer/filters', '*.rb')].each { |file| require_relative file }
|
27
28
|
Dir[File.join(__dir__, 'nexmo_markdown_renderer/filters/i18n', '*.rb')].each { |file| require_relative file }
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexmo_markdown_renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nexmo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: banzai
|
@@ -206,6 +206,20 @@ dependencies:
|
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '13.0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: capybara
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '3.31'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - "~>"
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '3.31'
|
209
223
|
description: Middleware to render Markdown Documents in Nexmo Developer Platform.
|
210
224
|
email:
|
211
225
|
- devrel@nexmo.com
|
@@ -248,6 +262,7 @@ files:
|
|
248
262
|
- lib/nexmo_markdown_renderer/filters/modal_filter.rb
|
249
263
|
- lib/nexmo_markdown_renderer/filters/partial_filter.rb
|
250
264
|
- lib/nexmo_markdown_renderer/filters/php_inliner_filter.rb
|
265
|
+
- lib/nexmo_markdown_renderer/filters/relative_link_filter.rb
|
251
266
|
- lib/nexmo_markdown_renderer/filters/screenshot_filter.rb
|
252
267
|
- lib/nexmo_markdown_renderer/filters/tab_filter.rb
|
253
268
|
- lib/nexmo_markdown_renderer/filters/techio_filter.rb
|
@@ -276,6 +291,7 @@ files:
|
|
276
291
|
- lib/nexmo_markdown_renderer/services/code_snippet_renderer/ruby.rb
|
277
292
|
- lib/nexmo_markdown_renderer/services/code_snippet_renderer/swift.rb
|
278
293
|
- lib/nexmo_markdown_renderer/services/doc_finder.rb
|
294
|
+
- lib/nexmo_markdown_renderer/services/doc_finder/doc.rb
|
279
295
|
- lib/nexmo_markdown_renderer/views/code_snippets/_application_messages_dispatch.html.erb
|
280
296
|
- lib/nexmo_markdown_renderer/views/code_snippets/_application_rtc.html.erb
|
281
297
|
- lib/nexmo_markdown_renderer/views/code_snippets/_application_voice.html.erb
|
@@ -286,7 +302,6 @@ files:
|
|
286
302
|
- lib/nexmo_markdown_renderer/views/code_snippets/list/plain.html.erb
|
287
303
|
- lib/nexmo_markdown_renderer/views/concepts/list/plain.html.erb
|
288
304
|
- lib/nexmo_markdown_renderer/views/use_case/_index.html.erb
|
289
|
-
- lib/nexmo_markdown_renderer/views/use_case/index.html.erb
|
290
305
|
- lib/nexmo_markdown_renderer/views/use_case/list/plain.html.erb
|
291
306
|
- lib/nexmo_markdown_renderer/views/use_case/show.html.erb
|
292
307
|
- lib/version.rb
|
@@ -313,8 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
313
328
|
- !ruby/object:Gem::Version
|
314
329
|
version: '0'
|
315
330
|
requirements: []
|
316
|
-
|
317
|
-
rubygems_version: 2.7.6
|
331
|
+
rubygems_version: 3.0.3
|
318
332
|
signing_key:
|
319
333
|
specification_version: 4
|
320
334
|
summary: Middleware to render Markdown Documents in Nexmo Developer Platform.
|
@@ -1,48 +0,0 @@
|
|
1
|
-
<h1>Use Cases</h1>
|
2
|
-
|
3
|
-
|
4
|
-
<style>
|
5
|
-
.tutorial-language-link svg {
|
6
|
-
height: 15px;
|
7
|
-
width: 15px;
|
8
|
-
}
|
9
|
-
</style>
|
10
|
-
|
11
|
-
<strong>Filter: </strong>
|
12
|
-
|
13
|
-
<div class="Vlt-dropdown">
|
14
|
-
<button class="Vlt-dropdown__btn">
|
15
|
-
Choose a language
|
16
|
-
</button>
|
17
|
-
<div class="Vlt-dropdown__panel">
|
18
|
-
<div class="Vlt-dropdown__panel__content">
|
19
|
-
<ul>
|
20
|
-
<% @languages.each do |lang| %>
|
21
|
-
<li><a class="Vlt-dropdown__link" href="<%= "#{@base_path}/#{lang.key}" %>"><svg style="height: 20px; width: 20px;" ><use xlink:href=<%= GEM_ROOT %>/lib/nexmo_markdown_renderer/assets/images/brands/<%= lang.icon %>.svg#<%= lang.icon %>"></use></svg><span><%= lang.label %></span></a></li>
|
22
|
-
<% end %>
|
23
|
-
</ul>
|
24
|
-
</div>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
|
28
|
-
|
29
|
-
<div class="Vlt-dropdown">
|
30
|
-
<button class="Vlt-dropdown__btn">
|
31
|
-
Choose a product
|
32
|
-
</button>
|
33
|
-
<div class="Vlt-dropdown__panel">
|
34
|
-
<div class="Vlt-dropdown__panel__content">
|
35
|
-
<ul>
|
36
|
-
<% @products.each do |product| %>
|
37
|
-
<li><a class="Vlt-dropdown__link" href="/<%= product['path'] %>/use-cases/<%= @language %>"><svg style="height: 20px; width: 20px;" class="Vlt-<%= product['icon_colour'] %>"><use xlink:href="/symbol/volta-icons.svg#Vlt-icon-<%= product['icon'] %>"></use></svgc><span><%= product['name'] %></span></a></li>
|
38
|
-
<% end %>
|
39
|
-
</ul>
|
40
|
-
</div>
|
41
|
-
</div>
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<br><br>
|
45
|
-
|
46
|
-
<p>Get started with Nexmo with tutorials that will walk you through building a variety of practical applications</p>
|
47
|
-
|
48
|
-
<%= render 'index' %>
|