graphql-docs 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Rakefile +1 -0
- data/graphql-docs.gemspec +1 -0
- data/lib/graphql-docs.rb +1 -0
- data/lib/graphql-docs/configuration.rb +1 -0
- data/lib/graphql-docs/generator.rb +4 -2
- data/lib/graphql-docs/helpers.rb +1 -0
- data/lib/graphql-docs/parser.rb +1 -0
- data/lib/graphql-docs/renderer.rb +6 -5
- data/lib/graphql-docs/version.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1be3cf99394c17dec2e6808c2190bcde9ab6853b
|
|
4
|
+
data.tar.gz: c90aea1970848013e577153479682d043a8491c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1612ff5cd6464ab3b9397782e8b7c6cd169d2259f23d418ce0cf35fa10c379950d3acf1187576fea4a112cb89a4caf156de4c6e5f57324cd75c344326da4bb41
|
|
7
|
+
data.tar.gz: 7abb66d7a2eeb1d561b908bad5eb549771507c956b5a631761439254f42b2180f324bead506bccf46be5ed6b0931cb28767c654f8bf6ed7f313ee9f98abd0271
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/graphql-docs.gemspec
CHANGED
data/lib/graphql-docs.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
require 'erb'
|
|
2
3
|
require 'sass'
|
|
3
4
|
|
|
@@ -210,8 +211,9 @@ module GraphQLDocs
|
|
|
210
211
|
contents.gsub!(/^\s{4}/m, ' ')
|
|
211
212
|
end
|
|
212
213
|
|
|
213
|
-
|
|
214
|
-
|
|
214
|
+
filename = File.join(path, 'index.html')
|
|
215
|
+
contents = @renderer.render(contents, type: type, name: name, filename: filename)
|
|
216
|
+
File.write(filename, contents) unless contents.nil?
|
|
215
217
|
end
|
|
216
218
|
end
|
|
217
219
|
end
|
data/lib/graphql-docs/helpers.rb
CHANGED
data/lib/graphql-docs/parser.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
require 'html/pipeline'
|
|
2
3
|
require 'yaml'
|
|
3
4
|
require 'extended-markdown-filter'
|
|
@@ -36,17 +37,17 @@ module GraphQLDocs
|
|
|
36
37
|
@pipeline = HTML::Pipeline.new(filters, @pipeline_config[:context])
|
|
37
38
|
end
|
|
38
39
|
|
|
39
|
-
def render(contents, type: nil, name: nil)
|
|
40
|
-
opts = { base_url: @options[:base_url] }.merge({ type: type, name: name}).merge(helper_methods)
|
|
40
|
+
def render(contents, type: nil, name: nil, filename: nil)
|
|
41
|
+
opts = { base_url: @options[:base_url], output_dir: @options[:output_dir] }.merge({ type: type, name: name, filename: filename}).merge(helper_methods)
|
|
41
42
|
|
|
42
|
-
contents = to_html(contents)
|
|
43
|
+
contents = to_html(contents, context: { filename: filename })
|
|
43
44
|
return contents if @graphql_default_layout.nil?
|
|
44
45
|
opts[:content] = contents
|
|
45
46
|
@graphql_default_layout.result(OpenStruct.new(opts).instance_eval { binding })
|
|
46
47
|
end
|
|
47
48
|
|
|
48
|
-
def to_html(string)
|
|
49
|
-
@pipeline.to_html(string)
|
|
49
|
+
def to_html(string, context: {})
|
|
50
|
+
@pipeline.to_html(string, context)
|
|
50
51
|
end
|
|
51
52
|
|
|
52
53
|
private
|
data/lib/graphql-docs/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: graphql-docs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Garen Torikian
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-06-
|
|
11
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: graphql
|