graphql-docs 0.2.2 → 0.3.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/README.md +1 -0
- data/lib/graphql-docs/configuration.rb +5 -0
- data/lib/graphql-docs/helpers.rb +1 -1
- data/lib/graphql-docs/layouts/includes/connections.html +1 -1
- data/lib/graphql-docs/layouts/includes/fields.html +2 -2
- data/lib/graphql-docs/layouts/includes/input_fields.html +1 -1
- data/lib/graphql-docs/layouts/includes/sidebar.html +6 -6
- data/lib/graphql-docs/version.rb +1 -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: 73edf72a2d765a3e79d721c603acc05832fae79f
|
4
|
+
data.tar.gz: a5f747385749b0babc5a2c42a60c7cbb98633a25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8846e1d564b782a17205374cbc151da843fdee19b4b967a54bb5cc889a7034a6fbe0e8b61e0141a0bfd78584c4c08a80437e0bad27755613859c41c867e7ca83
|
7
|
+
data.tar.gz: 060991173dbeedbb7b173f9c4c4f4c0b666f7b1f51d8214113c27fcf93c59550402eed3746efa508301cf274425817f9af59da29f810e8d31e83f149504629e2
|
data/README.md
CHANGED
@@ -134,6 +134,7 @@ The following options are available:
|
|
134
134
|
| `pipeline_config` | Defines two sub-keys, `pipeline` and `context`, which are used by `html-pipeline` when rendering your output. | `pipeline` has `ExtendedMarkdownFilter`, `EmojiFilter`, and `TableOfContentsFilter`. `context` has `gfm: false` and `asset_root` set to GitHub's CDN. |
|
135
135
|
| `renderer` | The rendering class to use. | `GraphQLDocs::Renderer`
|
136
136
|
| `templates` | The templates to use when generating HTML. You may override any of the following keys: `includes`, `objects`, `mutations`, `interfaces`, `enums`, `unions`, `input_objects`, `scalars`, `index`. | The defaults are found in _lib/graphql-docs/layouts/_.
|
137
|
+
| `classes` | Additional class names you can provide to certain elements. | The full list is found in _lib/graphql-docs/configuration.rb/_.
|
137
138
|
|
138
139
|
## Development
|
139
140
|
|
data/lib/graphql-docs/helpers.rb
CHANGED
@@ -12,7 +12,7 @@ module GraphQLDocs
|
|
12
12
|
|
13
13
|
def include(filename, opts = {})
|
14
14
|
template = fetch_include(filename)
|
15
|
-
opts = { base_url: @options[:base_url] }.merge(opts)
|
15
|
+
opts = { base_url: @options[:base_url], classes: @options[:classes] }.merge(opts)
|
16
16
|
template.result(OpenStruct.new(opts.merge(helper_methods)).instance_eval { binding })
|
17
17
|
end
|
18
18
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% connections.each do |connection| %>
|
2
2
|
|
3
|
-
<div class="field-entry
|
3
|
+
<div class="field-entry <%= classes[:field_entry] %>">
|
4
4
|
<span class="field-name connection-name"><%= connection['name'] %> (<a href="<%= base_url %>/object/<%= slugify.(connection['type']['ofType']['name']) %>" class="js-connection-name"><code><%= connection['type']['ofType']['name'] %></code></a>)</span>
|
5
5
|
|
6
6
|
<div class="description-wrapper">
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<% next if field['type']['ofType'] && field['type']['ofType']['name'] && field['type']['ofType']['name'].end_with?('Connection') %>
|
4
4
|
|
5
|
-
<div class="field-entry">
|
5
|
+
<div class="field-entry <%= classes[:field_entry] %>">
|
6
6
|
<% next if field['name'] == "id" || field['name'].blank? %>
|
7
7
|
|
8
8
|
<% if field['type']['ofType'] && !field['type']['ofType']['ofType'].nil? %>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
<div class="description-wrapper">
|
30
30
|
<% if field['isDeprecated'] %>
|
31
|
-
<div class="deprecation-notice">
|
31
|
+
<div class="deprecation-notice <%= classes[:deprecation_notice] %>">
|
32
32
|
<span class="deprecation-title">Deprecation notice</span>
|
33
33
|
<%= markdown.(field['deprecationReason']) %>
|
34
34
|
</div>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<% next if field['type']['ofType'] && field['type']['ofType']['name'] && field['type']['ofType']['name'].end_with?('Connection') %>
|
6
6
|
|
7
|
-
<div class="field-entry">
|
7
|
+
<div class="field-entry <%= classes[:field_entry] %>">
|
8
8
|
<% next if field['name'] == "id" || field['name'].blank? %>
|
9
9
|
|
10
10
|
<% if field['type']['ofType'] && !field['type']['ofType']['ofType'].nil? %>
|
@@ -43,7 +43,7 @@
|
|
43
43
|
<% end %>
|
44
44
|
|
45
45
|
<li>
|
46
|
-
<a href="<%= base_url %>/object/<%= @name.downcase %>/
|
46
|
+
<a href="<%= base_url %>/object/<%= @name.downcase %>/" class="sidebar-link<% if title == @name %> current<% end %>">
|
47
47
|
<%= @name %>
|
48
48
|
</a>
|
49
49
|
</li>
|
@@ -57,7 +57,7 @@
|
|
57
57
|
<% graphql_interface_types.().each do |type| %>
|
58
58
|
<% @name = type["name"] %>
|
59
59
|
<li>
|
60
|
-
<a href="<%= base_url %>/interface/<%= @name.downcase %>/
|
60
|
+
<a href="<%= base_url %>/interface/<%= @name.downcase %>/" class="sidebar-link<% if title == @name %> current<% end %>">
|
61
61
|
<%= @name %>
|
62
62
|
</a>
|
63
63
|
</li>
|
@@ -75,7 +75,7 @@
|
|
75
75
|
<% next %>
|
76
76
|
<% end %>
|
77
77
|
<li>
|
78
|
-
<a href="<%= base_url %>/enum/<%= @name.downcase %>/
|
78
|
+
<a href="<%= base_url %>/enum/<%= @name.downcase %>/" class="sidebar-link<% if title == @name %> current<% end %>">
|
79
79
|
<%= @name %>
|
80
80
|
</a>
|
81
81
|
</li>
|
@@ -89,7 +89,7 @@
|
|
89
89
|
<% graphql_union_types.().each do |type| %>
|
90
90
|
<% @name = type["name"] %>
|
91
91
|
<li>
|
92
|
-
<a href="<%= base_url %>/union/<%= @name.downcase %>/
|
92
|
+
<a href="<%= base_url %>/union/<%= @name.downcase %>/" class="sidebar-link<% if title == @name %> current<% end %>">
|
93
93
|
<%= @name %>
|
94
94
|
</a>
|
95
95
|
</li>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
<% graphql_input_object_types.().each do |type| %>
|
104
104
|
<% @name = type["name"] %>
|
105
105
|
<li>
|
106
|
-
<a href="<%= base_url %>/input_object/<%= @name.downcase %>/
|
106
|
+
<a href="<%= base_url %>/input_object/<%= @name.downcase %>/" class="sidebar-link<% if title == @name %> current<% end %>">
|
107
107
|
<%= @name %>
|
108
108
|
</a>
|
109
109
|
</li>
|
@@ -117,7 +117,7 @@
|
|
117
117
|
<% graphql_scalar_types.().each do |type| %>
|
118
118
|
<% @name = type["name"] %>
|
119
119
|
<li>
|
120
|
-
<a href="<%= base_url %>/scalar/<%= @name.downcase %>/
|
120
|
+
<a href="<%= base_url %>/scalar/<%= @name.downcase %>/" class="sidebar-link<% if title == @name %> current<% end %>">
|
121
121
|
<%= @name %>
|
122
122
|
</a>
|
123
123
|
</li>
|
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: 0.
|
4
|
+
version: 0.3.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: 2017-
|
11
|
+
date: 2017-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|