nexmo_markdown_renderer 0.7.5 → 0.7.6
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/code_snippet/import_dependencies.rb +2 -1
- data/lib/nexmo_markdown_renderer/filters/code_snippet/initialize_dependencies.rb +2 -1
- data/lib/nexmo_markdown_renderer/filters/code_snippet/instructions.rb +2 -1
- data/lib/nexmo_markdown_renderer/filters/tab_filter.rb +1 -0
- data/lib/nexmo_markdown_renderer/filters/utils.rb +4 -1
- data/lib/nexmo_markdown_renderer/services/code_snippet_renderer/curl.rb +8 -0
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7800ee97436dd0317d85c054ba7293f1207c2e0ac9e90b1f1f443df61319d51
|
4
|
+
data.tar.gz: cf859ca6c2f8d165e4057242f460dc4e0bdabe4419a4e25f94e0c1611181ccf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00fa691a0b76fabaa820fbc90bd68b87ab0a9a7bf4fa87a949f153fa4031845000375ec661f721154932db2f357bc4358ff1e6f8cc28d7808c52288db655ecee
|
7
|
+
data.tar.gz: fb66fcd2e4582e40ac53dfc1bd74af9ddaa13c22f71e9f0d62ab45bcc9986a51ad5c5801bc6e0dccfbe42f93e50682fc3bfd26d18eb0e2616f10f7ea90227419
|
@@ -26,7 +26,7 @@ module Nexmo
|
|
26
26
|
start_section + file_section + line_section
|
27
27
|
end
|
28
28
|
|
29
|
-
def self.generate_code_block(language, input, unindent)
|
29
|
+
def self.generate_code_block(language, input, unindent, renderer)
|
30
30
|
return '' unless input
|
31
31
|
filename = "#{Nexmo::Markdown::Config.docs_base_path}/#{input['source']}"
|
32
32
|
raise "CodeSnippetFilter - Could not load #{filename} for language #{language}" unless File.exist?(filename)
|
@@ -42,6 +42,9 @@ module Nexmo
|
|
42
42
|
|
43
43
|
code = code.lines[from_line..to_line].join
|
44
44
|
code.unindent! if unindent
|
45
|
+
|
46
|
+
code = renderer.post_process(code) if renderer.respond_to?(:post_process)
|
47
|
+
|
45
48
|
formatter = Rouge::Formatters::HTML.new
|
46
49
|
formatter.format(lexer.lex(code))
|
47
50
|
end
|
@@ -22,6 +22,14 @@ module Nexmo
|
|
22
22
|
def self.add_instructions(filename)
|
23
23
|
::I18n.t('services.code_snippet_renderer.add_instructions_to_file', file: filename)
|
24
24
|
end
|
25
|
+
|
26
|
+
def self.post_process(code)
|
27
|
+
self.strip_single_quotes(code)
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.strip_single_quotes(code)
|
31
|
+
code.gsub(/"'(\$\w+)'"/, '"\1"')
|
32
|
+
end
|
25
33
|
end
|
26
34
|
end
|
27
35
|
|
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.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nexmo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: banzai
|