banana_docs 0.0.4 → 0.0.5
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.
- data/assets/css/custom.css +41 -1
- data/lib/banana_docs/helpers.rb +9 -10
- data/lib/banana_docs/version.rb +1 -1
- metadata +1 -1
data/assets/css/custom.css
CHANGED
@@ -1,2 +1,42 @@
|
|
1
|
+
body {
|
2
|
+
font-family: 'Ubuntu';
|
3
|
+
font-size: 15px;
|
4
|
+
}
|
5
|
+
code, pre { font-family: 'Ubuntu Mono';}
|
6
|
+
code {
|
7
|
+
color: #2E7A0B;
|
8
|
+
font-size: 13px;
|
9
|
+
padding: 1px 5px 3px 5px;
|
10
|
+
}
|
11
|
+
pre {
|
12
|
+
background-color: #333333;
|
13
|
+
color: #f0f0f0;
|
14
|
+
}
|
15
|
+
.nav {
|
16
|
+
font-size: 13px;
|
17
|
+
}
|
18
|
+
h5 { font-size: 16px; }
|
19
|
+
|
20
|
+
.label, .badge {
|
21
|
+
line-height: 15px;
|
22
|
+
}
|
23
|
+
|
24
|
+
.table .label-inverse {
|
25
|
+
background-color: #535353;
|
26
|
+
}
|
27
|
+
|
1
28
|
.container { width: 80%; margin: 50px auto; }
|
2
|
-
.fixed { position: fixed; right: 10%; }
|
29
|
+
.fixed { position: fixed; right: 10%; }
|
30
|
+
|
31
|
+
hr { border-top: 1px solid #DDD; }
|
32
|
+
|
33
|
+
span.response {
|
34
|
+
font-weight: bold;
|
35
|
+
font-size: 14px;
|
36
|
+
}
|
37
|
+
|
38
|
+
span.response i.icon-chevron-right {
|
39
|
+
position: relative;
|
40
|
+
left: -3px;
|
41
|
+
top: 2px;
|
42
|
+
}
|
data/lib/banana_docs/helpers.rb
CHANGED
@@ -5,7 +5,7 @@ class BananaDocs::Helpers
|
|
5
5
|
include ActionView::Helpers::TagHelper
|
6
6
|
include ActionView::Helpers::UrlHelper
|
7
7
|
|
8
|
-
FIXED_COLUMNS = ['Parâmetro', 'Descrição', 'Tipo', 'Formato', 'Observações', '
|
8
|
+
FIXED_COLUMNS = ['Parâmetro', 'Descrição', 'Tipo', 'Formato', 'Observações', 'Obrigatório?']
|
9
9
|
|
10
10
|
def initialize
|
11
11
|
@navigations = []
|
@@ -26,7 +26,7 @@ class BananaDocs::Helpers
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def action(title, options)
|
29
|
-
content_tag(:h5, encode(
|
29
|
+
content_tag(:h5, encode(title)) +
|
30
30
|
content_tag(:code, "#{options[:method]} #{options[:url]}") +
|
31
31
|
content_tag(:br)
|
32
32
|
end
|
@@ -43,10 +43,10 @@ class BananaDocs::Helpers
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def param(name, description, type, format, options = {})
|
46
|
-
obs = options[:obs].nil? ? '
|
47
|
-
required, clazz = options[:required] ? ['Sim', 'badge badge-
|
46
|
+
obs = options[:obs].nil? ? '-' : options[:obs]
|
47
|
+
required, clazz = options[:required] ? ['Sim', 'badge badge-important'] : ['Não', 'badge badge-info']
|
48
48
|
content_tag(:tr) do
|
49
|
-
content_tag(:td, build_span(name, '
|
49
|
+
content_tag(:td, build_span(name, 'label label-inverse')) +
|
50
50
|
content_tag(:td, encode(description)) +
|
51
51
|
content_tag(:td, encode(type)) +
|
52
52
|
content_tag(:td, encode(format)) +
|
@@ -78,9 +78,8 @@ class BananaDocs::Helpers
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def response(&block)
|
81
|
-
content_tag(:hr).html_safe +
|
82
81
|
content_tag(:div) do
|
83
|
-
content_tag(:span, 'Exemplos de respostas', class: '
|
82
|
+
content_tag(:span, content_tag(:i, "", class: 'icon-chevron-right').html_safe + 'Exemplos de respostas', class: 'response') +
|
84
83
|
content_tag(:br) +
|
85
84
|
yield.html_safe
|
86
85
|
end
|
@@ -97,12 +96,12 @@ class BananaDocs::Helpers
|
|
97
96
|
end
|
98
97
|
|
99
98
|
def key_value(key, value, show_keys = true)
|
100
|
-
value = value.starts_with?('[') ? value : "\"#{value}\""
|
101
|
-
(show_keys ? "{ \"#{key}\":#{value} }" : "\"#{key}\": #{value}, ").html_safe
|
99
|
+
value = value.starts_with?('[') ? encode(value) : "\"#{encode value}\""
|
100
|
+
(show_keys ? "{ \"#{encode key}\":#{encode value} }" : "\"#{encode key}\": #{encode value}, ").html_safe
|
102
101
|
end
|
103
102
|
|
104
103
|
def key_with_block(key, &block)
|
105
|
-
"{ \"#{key}\": { #{yield} } }".html_safe
|
104
|
+
"{ \"#{encode key}\": { #{yield} } }".html_safe
|
106
105
|
end
|
107
106
|
|
108
107
|
def empty
|
data/lib/banana_docs/version.rb
CHANGED