From 855815911ede49db171a80700902f8e27f465812 Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Mon, 4 Mar 2019 11:58:07 -0500 Subject: [PATCH 1/3] Add deprecation clause to connection include --- lib/graphql-docs/layouts/includes/connections.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/graphql-docs/layouts/includes/connections.html b/lib/graphql-docs/layouts/includes/connections.html index 4e5c3a1..262d28b 100644 --- a/lib/graphql-docs/layouts/includes/connections.html +++ b/lib/graphql-docs/layouts/includes/connections.html @@ -4,7 +4,15 @@ <%= connection[:name] %> (<%= connection[:type][:info] %>)
+ <% if connection[:is_deprecated] %> +
+ Deprecation notice + <%= markdownify.(connection[:deprecation_reason]) %> +
+ <% end %> + <%= include.('notices.html', notices: connection[:notices]) %> +

<%= connection[:description] %>

<% unless connection[:arguments].empty? %> From b11e9aa624657b1ad1c51db6af20cd38c80a5e67 Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Mon, 4 Mar 2019 12:00:53 -0500 Subject: [PATCH 2/3] Parse markdown on connection field descriptions --- lib/graphql-docs/layouts/includes/connections.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/graphql-docs/layouts/includes/connections.html b/lib/graphql-docs/layouts/includes/connections.html index 262d28b..e92955c 100644 --- a/lib/graphql-docs/layouts/includes/connections.html +++ b/lib/graphql-docs/layouts/includes/connections.html @@ -13,7 +13,7 @@ <%= include.('notices.html', notices: connection[:notices]) %> -

<%= connection[:description] %>

+

<%= markdownify.(connection[:description]) %>

<% unless connection[:arguments].empty? %> <%= include.('arguments.html', arguments: connection[:arguments]) %> From 677e82d8a38bf0cb4b9e7a9b243e6fa17281590b Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Mon, 4 Mar 2019 12:54:19 -0500 Subject: [PATCH 3/3] Standerdized deprecation notices --- .../layouts/includes/connections.html | 9 ++------- .../layouts/includes/deprecations.html | 6 ++++++ lib/graphql-docs/layouts/includes/fields.html | 18 ++++++------------ lib/graphql-docs/layouts/includes/values.html | 11 +++-------- 4 files changed, 17 insertions(+), 27 deletions(-) create mode 100644 lib/graphql-docs/layouts/includes/deprecations.html diff --git a/lib/graphql-docs/layouts/includes/connections.html b/lib/graphql-docs/layouts/includes/connections.html index e92955c..66e442e 100644 --- a/lib/graphql-docs/layouts/includes/connections.html +++ b/lib/graphql-docs/layouts/includes/connections.html @@ -4,16 +4,11 @@ <%= connection[:name] %> (<%= connection[:type][:info] %>)
- <% if connection[:is_deprecated] %> -
- Deprecation notice - <%= markdownify.(connection[:deprecation_reason]) %> -
- <% end %> + <%= include.('deprecations.html', item: connection) %> <%= include.('notices.html', notices: connection[:notices]) %> -

<%= markdownify.(connection[:description]) %>

+ <%= markdownify.(connection[:description]) %> <% unless connection[:arguments].empty? %> <%= include.('arguments.html', arguments: connection[:arguments]) %> diff --git a/lib/graphql-docs/layouts/includes/deprecations.html b/lib/graphql-docs/layouts/includes/deprecations.html new file mode 100644 index 0000000..c8290c4 --- /dev/null +++ b/lib/graphql-docs/layouts/includes/deprecations.html @@ -0,0 +1,6 @@ +<% if item[:is_deprecated] %> +
+ Deprecation notice + <%= markdownify.(item[:deprecation_reason]) %> +
+<% end %> diff --git a/lib/graphql-docs/layouts/includes/fields.html b/lib/graphql-docs/layouts/includes/fields.html index 9c1a97c..57d5695 100644 --- a/lib/graphql-docs/layouts/includes/fields.html +++ b/lib/graphql-docs/layouts/includes/fields.html @@ -4,21 +4,15 @@ <%= field[:name] %> (<%= field[:type][:info] %>)
- <% if field[:is_deprecated] %> -
- Deprecation notice - <%= markdownify.(field[:deprecation_reason]) %> -
- <% end %> + <%= include.('deprecations.html', item: field) %> - <%= include.('notices.html', notices: field[:notices]) %> + <%= include.('notices.html', notices: field[:notices]) %> - <%= markdownify.(field[:description]) %> - - <% unless field[:arguments].empty? %> - <%= include.('arguments.html', arguments: field[:arguments]) %> - <% end %> + <%= markdownify.(field[:description]) %> + <% unless field[:arguments].empty? %> + <%= include.('arguments.html', arguments: field[:arguments]) %> + <% end %>
diff --git a/lib/graphql-docs/layouts/includes/values.html b/lib/graphql-docs/layouts/includes/values.html index ebe5e6a..6b333a7 100644 --- a/lib/graphql-docs/layouts/includes/values.html +++ b/lib/graphql-docs/layouts/includes/values.html @@ -5,16 +5,11 @@

Values

<%= value[:name] %>

- <%= include.('notices.html', notices: value[:notices]) %> + <%= include.('deprecations.html', item: value) %> - <% if value[:is_deprecated] %> -
- Deprecation notice - <%= markdownify.(value[:deprecation_reason]) %> -
- <% end %> + <%= include.('notices.html', notices: value[:notices]) %> -

<%= value[:description] %>

+ <%= markdownify.(value[:description]) %>
<% end %>