apipie-dsl 2.2.9 → 2.2.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06cfa92a5d84bc9ca6db419ec1948d66541b414a57a68cc5316c335142b98c8f
4
- data.tar.gz: 5b2a03b6201ddcd2a61fd8e481be673a0383e06b012ba433f0b76cf266094f05
3
+ metadata.gz: 990ebec629f1450a927333b32acec610e62378a52dd4d04247de392fa15376ad
4
+ data.tar.gz: 15a19b903fa3a51096eda59a022ffcfaaaf1bbe82d9253a25b7696a6c04321bc
5
5
  SHA512:
6
- metadata.gz: f9684334d6aa6a515e4993601ca0b5f53187aebe2e64de43baad932f95abc51f5730945b8d81260baf61cc4af934b235d51bef161593334f4369111f9fc568e5
7
- data.tar.gz: 77a23f53bb07eb0795a709f15b492e1cad04912770e0f32328092ba5cbe6cd1c70bc94f05564a05c97fa397daa8ac61ac9f44f6d0ab8fe9dd784364eebf4389d
6
+ metadata.gz: 8b0a2d9ea7df944cb6b1585db1bc18bc98220ffab60e612e832e9eddbd0e19668067da1b950b342b906a36e922c4f539d35ccf4a9d70977593a5931195d16e94
7
+ data.tar.gz: ab9e8070fed5ce6cb24c5da93ec3c4b297cb792fa704b5e3fcc2f74c40927deaf608e0401de6dc5eef46fc784e9a89300b9317768398a44f78805c2ccb766333
@@ -22,13 +22,13 @@ module ApipieDslHelper
22
22
  content_tag(:ul, class: 'breadcrumb') do
23
23
  content = dsl_sections.map do |section|
24
24
  content_tag(:li, class: section == @section ? 'active' : '') do
25
- link_to(t("apipie_dsl.#{section}"), @doc[:doc_url] + section_ext(section) + @doc[:link_extension])
25
+ link_to(_(section.titleize), @doc[:doc_url] + section_ext(section) + @doc[:link_extension])
26
26
  end
27
27
  end.join(' | ').html_safe
28
28
 
29
29
  unless ApipieDSL.configuration.help_layout.nil?
30
30
  content += content_tag(:li, class: "pull-right #{'active' if @section == 'help'}") do
31
- link_to(t("apipie_dsl.help"), @doc[:doc_url] + section_ext('help') + @doc[:link_extension])
31
+ link_to(_('Help'), @doc[:doc_url] + section_ext('help') + @doc[:link_extension])
32
32
  end
33
33
  end
34
34
  end
@@ -36,11 +36,11 @@ module ApipieDslHelper
36
36
 
37
37
  def apipie_dsl_example(source, output = nil)
38
38
  text = content_tag(:p, _('Example input:')) +
39
- content_tag(:pre, source)
39
+ content_tag(:pre, source, class: 'wiki')
40
40
 
41
41
  if output.present?
42
42
  text += content_tag(:p, _('Example output:')) +
43
- content_tag(:pre, output)
43
+ content_tag(:pre, output, class: 'wiki')
44
44
  end
45
45
 
46
46
  text.html_safe
@@ -5,3 +5,14 @@ body {
5
5
  .sidebar-nav {
6
6
  padding: 9px 0;
7
7
  }
8
+
9
+ pre:not(.prettyprint):not(.wiki) {
10
+ margin: 0 0 9px;
11
+ padding: 0;
12
+ font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
13
+ font-size: 13px;
14
+ line-height: 18px;
15
+ color: #333333;
16
+ background-color: inherit;
17
+ border: none;
18
+ }
@@ -3,6 +3,16 @@
3
3
  <%= render(partial: 'metadata', locals: { meta: property[:metadata] }) %>
4
4
  <% end %>
5
5
 
6
+ <% unless property[:examples].blank? %>
7
+ <%= heading(t('apipie_dsl.examples'), h_level) %>
8
+ <% property[:examples].each do |example| %>
9
+ <% if example[:desc] %>
10
+ <p><%= example[:desc] %></p>
11
+ <% end %>
12
+ <pre class="prettyprint"><%= example[:example] %></pre>
13
+ <% end %>
14
+ <% end %>
15
+
6
16
  <% unless property[:params].blank? %>
7
17
  <%= heading(t('apipie_dsl.params'), h_level) %>
8
18
  <table class='table'>
@@ -42,7 +42,10 @@
42
42
  <% unless prop[:examples].blank? %>
43
43
  <h4><%= t('apipie_dsl.examples') %></h4>
44
44
  <% prop[:examples].each do |example| %>
45
- <pre class="wiki"><%= example %></pre>
45
+ <% if example[:desc] %>
46
+ <p><%= example[:desc] %></p>
47
+ <% end %>
48
+ <pre class="wiki"><%= example[:example] %></pre>
46
49
  <% end %>
47
50
  <% end %>
48
51
 
@@ -79,7 +82,10 @@
79
82
  <% unless method[:examples].blank? %>
80
83
  <h4><%= t('apipie_dsl.examples') %></h4>
81
84
  <% method[:examples].each do |example| %>
82
- <pre class="wiki"><%= example %></pre>
85
+ <% if example[:desc] %>
86
+ <p><%= example[:desc] %></p>
87
+ <% end %>
88
+ <pre class="wiki"><%= example[:example] %></pre>
83
89
  <% end %>
84
90
  <% end %>
85
91
 
@@ -59,7 +59,10 @@
59
59
  <% unless prop[:examples].blank? %>
60
60
  <h2><%= t('apipie_dsl.examples') %></h2>
61
61
  <% prop[:examples].each do |example| %>
62
- <pre><%= example %></pre>
62
+ <% if example[:desc] %>
63
+ <p><%= example[:desc] %></p>
64
+ <% end %>
65
+ <pre><%= example[:example] %></pre>
63
66
  <% end %>
64
67
  <% end %>
65
68
 
@@ -107,7 +110,10 @@
107
110
  <% unless method[:examples].blank? %>
108
111
  <h2><%= t('apipie_dsl.examples') %></h2>
109
112
  <% method[:examples].each do |example| %>
110
- <pre><%= example %></pre>
113
+ <% if example[:desc] %>
114
+ <p><%= example[:desc] %></p>
115
+ <% end %>
116
+ <pre class="prettyprint"><%= example[:example] %></pre>
111
117
  <% end %>
112
118
  <% end %>
113
119
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApipieDSL
4
- VERSION = '2.2.9'
4
+ VERSION = '2.2.10'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apipie-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.9
4
+ version: 2.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleh Fedorenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-23 00:00:00.000000000 Z
11
+ date: 2020-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler