graphql-docs 1.3.1 → 1.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31fc64ae0c98a0f3d64089f05a79a1ba85211c9b
4
- data.tar.gz: 1b1e3d9b088a3e449a3796d81f3756ddc73f89d1
3
+ metadata.gz: 32e7dc48eae7a31c1e21898bbd36d3f48e396d6e
4
+ data.tar.gz: cfc7ecedfd2a2328965fc4d96a84cd8ca9d68701
5
5
  SHA512:
6
- metadata.gz: afeb954d34ee99d1bbbdcbb455dc0558049fff482bbcd35e4d57c58ef8122632c83e02aa1468444a761f822bb9b3fbaccf7379d2c843901d6342bf96f3687cd6
7
- data.tar.gz: ebbc964ba93e5e97393d274f810a948f23104a1ebd0478afb198de7a6c5b1ac6637d2a8e136f11e553c7be02885c0ac5ce576a9893f7d2658885206703a27d22
6
+ metadata.gz: 6e05552c45fb38032bda7575f625ad94d78dffa835eb7e36d975f22b27694e006b80d1156623387b936ef6a6794b5571be454b9a1cd625293613add82ea0b5f8
7
+ data.tar.gz: 92b76f1af8fc7a33652ec515e1b39aceabd3fece43e417d23fce0d445bb86a85deab78c41ba6a372afba7e43ceafd14f92303af24ca300ba79678a5f7dd6017f
@@ -13,14 +13,14 @@ module GraphQLDocs
13
13
 
14
14
  @renderer = @options[:renderer].new(@parsed_schema, @options)
15
15
 
16
- @graphql_operation_template = ERB.new(File.read(@options[:templates][:operations]))
17
- @graphql_object_template = ERB.new(File.read(@options[:templates][:objects]))
18
- @graphql_mutations_template = ERB.new(File.read(@options[:templates][:mutations]))
19
- @graphql_interfaces_template = ERB.new(File.read(@options[:templates][:interfaces]))
20
- @graphql_enums_template = ERB.new(File.read(@options[:templates][:enums]))
21
- @graphql_unions_template = ERB.new(File.read(@options[:templates][:unions]))
22
- @graphql_input_objects_template = ERB.new(File.read(@options[:templates][:input_objects]))
23
- @graphql_scalars_template = ERB.new(File.read(@options[:templates][:scalars]))
16
+ @graphql_operation_template = ERB.new(File.read(@options[:templates][:operations]), nil, '<>')
17
+ @graphql_object_template = ERB.new(File.read(@options[:templates][:objects]), nil, '<>')
18
+ @graphql_mutations_template = ERB.new(File.read(@options[:templates][:mutations]), nil, '<>')
19
+ @graphql_interfaces_template = ERB.new(File.read(@options[:templates][:interfaces]), nil, '<>')
20
+ @graphql_enums_template = ERB.new(File.read(@options[:templates][:enums]), nil, '<>')
21
+ @graphql_unions_template = ERB.new(File.read(@options[:templates][:unions]), nil, '<>')
22
+ @graphql_input_objects_template = ERB.new(File.read(@options[:templates][:input_objects]), nil, '<>')
23
+ @graphql_scalars_template = ERB.new(File.read(@options[:templates][:scalars]), nil, '<>')
24
24
  end
25
25
 
26
26
  def generate
@@ -191,10 +191,6 @@ module GraphQLDocs
191
191
  @options = @options.merge(meta)
192
192
  end
193
193
 
194
- # normalize spacing so that CommonMarker doesn't treat it as `pre`
195
- contents.gsub!(/^\s*$/, '')
196
- contents.gsub!(/^\s{4}/m, ' ')
197
-
198
194
  contents = @renderer.render(contents, type: type, name: name)
199
195
  File.write(File.join(path, 'index.html'), contents) unless contents.nil?
200
196
  end
@@ -87,7 +87,7 @@ module GraphQLDocs
87
87
 
88
88
  contents = File.read(File.join(@options[:templates][:includes], filename))
89
89
 
90
- @templates[filename] = ERB.new(contents)
90
+ @templates[filename] = ERB.new(contents, nil, '<>')
91
91
  end
92
92
 
93
93
  def helper_methods
@@ -16,7 +16,7 @@
16
16
  visible: 'hover',
17
17
  icon: '¶'
18
18
  };
19
- anchors.add('h3');
19
+ anchors.add('h2, h3, h4, h5, h6, .anchored');
20
20
  });
21
21
 
22
22
  </script>
@@ -9,7 +9,7 @@
9
9
  <tbody>
10
10
  <% arguments.each do |argument| %>
11
11
  <tr>
12
- <td><code><%= argument[:name] %></code></td>
12
+ <td><code class="anchored"><%= argument[:name] %></code></td>
13
13
  <td>
14
14
  <code><a href="<%= base_url %>/<%= argument[:type][:path]%>"><%= argument[:type][:info] %></a></code>
15
15
  </td>
@@ -1,7 +1,7 @@
1
1
  <% connections.each do |connection| %>
2
2
 
3
3
  <div class="field-entry <%= classes[:field_entry] %>">
4
- <span id="<%= slugify.(connection[:name]) %>" class="field-name connection-name"><%= connection[:name] %> (<code><a href="<%= base_url %>/<%= connection[:type][:path] %>"><%= connection[:type][:info] %></a></code>)</span>
4
+ <span id="<%= slugify.(connection[:name]) %>" class="field-name connection-name anchored"><%= connection[:name] %> (<code><a href="<%= base_url %>/<%= connection[:type][:path] %>"><%= connection[:type][:info] %></a></code>)</span>
5
5
 
6
6
  <div class="description-wrapper">
7
7
  <%= include.('notices.html', notices: connection[:notices]) %>
@@ -1,7 +1,7 @@
1
1
  <% fields.each do |field| %>
2
2
 
3
3
  <div class="field-entry <%= classes[:field_entry] %>">
4
- <span id="<%= slugify.(field[:name]) %>" class="field-name"><%= field[:name] %> (<code><a href="<%= base_url %>/<%= field[:type][:path] %>"><%= field[:type][:info] %></a></code>)</span>
4
+ <span id="<%= slugify.(field[:name]) %>" class="field-name anchored"><%= field[:name] %> (<code><a href="<%= base_url %>/<%= field[:type][:path] %>"><%= field[:type][:info] %></a></code>)</span>
5
5
 
6
6
  <div class="description-wrapper">
7
7
  <% if field[:is_deprecated] %>
@@ -1,7 +1,7 @@
1
1
  <% input_fields.each do |field| %>
2
2
 
3
3
  <div class="field-entry <%= classes[:field_entry] %>">
4
- <span id="<%= slugify.(field[:name]) %>" class="field-name"><%= field[:name] %> (<code><a href="<%= base_url %>/<%= field[:type][:path] %>"><%= field[:type][:info] %></a></code>)</span>
4
+ <span id="<%= slugify.(field[:name]) %>" class="field-name anchored"><%= field[:name] %> (<code><a href="<%= base_url %>/<%= field[:type][:path] %>"><%= field[:type][:info] %></a></code>)</span>
5
5
 
6
6
  <div class="description-wrapper">
7
7
  <%= include.('notices.html', notices: field[:notices]) %>
@@ -2,7 +2,7 @@
2
2
 
3
3
  <% values.each do |value| %>
4
4
 
5
- <h4 id="<%= slugify.(value[:name]) %>" class="name"><%= value[:name] %></h4>
5
+ <h4 id="<%= slugify.(value[:name]) %>" class="name anchored"><%= value[:name] %></h4>
6
6
 
7
7
  <div class="description-wrapper">
8
8
  <%= include.('notices.html', notices: value[:notices]) %>
@@ -1,3 +1,3 @@
1
1
  module GraphQLDocs
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
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.3.1
4
+ version: 1.3.2
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-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql