cabbage_doc 0.1.2 → 0.1.3

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cabbage_doc.rb +7 -1
  3. data/lib/cabbage_doc/configuration.rb +5 -2
  4. data/lib/cabbage_doc/controller.rb +22 -11
  5. data/lib/cabbage_doc/highlighter.rb +23 -0
  6. data/lib/cabbage_doc/markdown.rb +28 -0
  7. data/lib/cabbage_doc/parser.rb +7 -3
  8. data/lib/cabbage_doc/response.rb +16 -8
  9. data/lib/cabbage_doc/task.rb +4 -3
  10. data/lib/cabbage_doc/version.rb +1 -1
  11. data/lib/cabbage_doc/web.rb +3 -2
  12. data/lib/cabbage_doc/web_helper.rb +11 -9
  13. data/web/public/css/highlight/github.css +185 -75
  14. data/web/public/css/highlight/molokai.css +208 -0
  15. data/web/public/css/highlight/monokai.css +202 -62
  16. data/web/public/css/highlight/thankful_eyes.css +173 -0
  17. data/web/public/css/{application.css → styles.css} +54 -3
  18. data/web/public/js/application.js +0 -9
  19. data/web/views/example.haml +1 -3
  20. data/web/views/layout.haml +3 -4
  21. data/web/views/page_layout.haml +4 -2
  22. data/web/views/response.haml +5 -10
  23. metadata +34 -51
  24. data/web/public/css/base.css +0 -23
  25. data/web/public/css/highlight/agate.css +0 -108
  26. data/web/public/css/highlight/androidstudio.css +0 -66
  27. data/web/public/css/highlight/arduino-light.css +0 -88
  28. data/web/public/css/highlight/arta.css +0 -73
  29. data/web/public/css/highlight/ascetic.css +0 -45
  30. data/web/public/css/highlight/codepen-embed.css +0 -60
  31. data/web/public/css/highlight/darkula.css +0 -74
  32. data/web/public/css/highlight/default.css +0 -99
  33. data/web/public/css/highlight/docco.css +0 -97
  34. data/web/public/css/highlight/dracula.css +0 -76
  35. data/web/public/css/highlight/foundation.css +0 -88
  36. data/web/public/css/highlight/github-gist.css +0 -71
  37. data/web/public/css/highlight/googlecode.css +0 -89
  38. data/web/public/css/highlight/grayscale.css +0 -101
  39. data/web/public/css/highlight/hybrid.css +0 -102
  40. data/web/public/css/highlight/idea.css +0 -97
  41. data/web/public/css/highlight/ir-black.css +0 -73
  42. data/web/public/css/highlight/magula.css +0 -70
  43. data/web/public/css/highlight/mono-blue.css +0 -59
  44. data/web/public/css/highlight/monokai-sublime.css +0 -83
  45. data/web/public/css/highlight/obsidian.css +0 -88
  46. data/web/public/css/highlight/purebasic.css +0 -96
  47. data/web/public/css/highlight/qtcreator_dark.css +0 -83
  48. data/web/public/css/highlight/qtcreator_light.css +0 -83
  49. data/web/public/css/highlight/railscasts.css +0 -106
  50. data/web/public/css/highlight/rainbow.css +0 -85
  51. data/web/public/css/highlight/school-book.css +0 -72
  52. data/web/public/css/highlight/solarized-dark.css +0 -84
  53. data/web/public/css/highlight/solarized-light.css +0 -84
  54. data/web/public/css/highlight/sunburst.css +0 -102
  55. data/web/public/css/highlight/vs.css +0 -68
  56. data/web/public/css/highlight/xcode.css +0 -93
  57. data/web/public/css/highlight/zenburn.css +0 -80
  58. data/web/public/js/highlight.min.js +0 -3
@@ -0,0 +1,173 @@
1
+ .highlight table td { padding: 5px; }
2
+ .highlight table pre { margin: 0; }
3
+ .highlight {
4
+ color: #faf6e4;
5
+ background-color: #122b3b;
6
+ }
7
+ .highlight .gl {
8
+ color: #dee5e7;
9
+ background-color: #4e5d62;
10
+ }
11
+ .highlight .gp {
12
+ color: #a8e1fe;
13
+ font-weight: bold;
14
+ }
15
+ .highlight .c, .highlight .cd, .highlight .cm, .highlight .c1, .highlight .cs {
16
+ color: #6c8b9f;
17
+ font-style: italic;
18
+ }
19
+ .highlight .cp {
20
+ color: #b2fd6d;
21
+ font-weight: bold;
22
+ font-style: italic;
23
+ }
24
+ .highlight .err {
25
+ color: #fefeec;
26
+ background-color: #cc0000;
27
+ }
28
+ .highlight .gr {
29
+ color: #cc0000;
30
+ font-weight: bold;
31
+ font-style: italic;
32
+ }
33
+ .highlight .k, .highlight .kd, .highlight .kv {
34
+ color: #f6dd62;
35
+ font-weight: bold;
36
+ }
37
+ .highlight .o, .highlight .ow {
38
+ color: #4df4ff;
39
+ font-weight: bold;
40
+ }
41
+ .highlight .p, .highlight .pi {
42
+ color: #4df4ff;
43
+ }
44
+ .highlight .gd {
45
+ color: #cc0000;
46
+ }
47
+ .highlight .gi {
48
+ color: #b2fd6d;
49
+ }
50
+ .highlight .ge {
51
+ font-style: italic;
52
+ }
53
+ .highlight .gs {
54
+ font-weight: bold;
55
+ }
56
+ .highlight .gt {
57
+ color: #dee5e7;
58
+ background-color: #4e5d62;
59
+ }
60
+ .highlight .kc {
61
+ color: #f696db;
62
+ font-weight: bold;
63
+ }
64
+ .highlight .kn {
65
+ color: #ffb000;
66
+ font-weight: bold;
67
+ }
68
+ .highlight .kp {
69
+ color: #ffb000;
70
+ font-weight: bold;
71
+ }
72
+ .highlight .kr {
73
+ color: #ffb000;
74
+ font-weight: bold;
75
+ }
76
+ .highlight .gh {
77
+ color: #ffb000;
78
+ font-weight: bold;
79
+ }
80
+ .highlight .gu {
81
+ color: #ffb000;
82
+ font-weight: bold;
83
+ }
84
+ .highlight .kt {
85
+ color: #b2fd6d;
86
+ font-weight: bold;
87
+ }
88
+ .highlight .no {
89
+ color: #b2fd6d;
90
+ font-weight: bold;
91
+ }
92
+ .highlight .nc {
93
+ color: #b2fd6d;
94
+ font-weight: bold;
95
+ }
96
+ .highlight .nd {
97
+ color: #b2fd6d;
98
+ font-weight: bold;
99
+ }
100
+ .highlight .nn {
101
+ color: #b2fd6d;
102
+ font-weight: bold;
103
+ }
104
+ .highlight .bp {
105
+ color: #b2fd6d;
106
+ font-weight: bold;
107
+ }
108
+ .highlight .ne {
109
+ color: #b2fd6d;
110
+ font-weight: bold;
111
+ }
112
+ .highlight .nl {
113
+ color: #ffb000;
114
+ font-weight: bold;
115
+ }
116
+ .highlight .nt {
117
+ color: #ffb000;
118
+ font-weight: bold;
119
+ }
120
+ .highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mb, .highlight .mx {
121
+ color: #f696db;
122
+ font-weight: bold;
123
+ }
124
+ .highlight .ld {
125
+ color: #f696db;
126
+ font-weight: bold;
127
+ }
128
+ .highlight .ss {
129
+ color: #f696db;
130
+ font-weight: bold;
131
+ }
132
+ .highlight .s, .highlight .sb, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .sr, .highlight .s1 {
133
+ color: #fff0a6;
134
+ font-weight: bold;
135
+ }
136
+ .highlight .se {
137
+ color: #4df4ff;
138
+ font-weight: bold;
139
+ }
140
+ .highlight .sc {
141
+ color: #4df4ff;
142
+ font-weight: bold;
143
+ }
144
+ .highlight .si {
145
+ color: #4df4ff;
146
+ font-weight: bold;
147
+ }
148
+ .highlight .nb {
149
+ font-weight: bold;
150
+ }
151
+ .highlight .ni {
152
+ color: #999999;
153
+ font-weight: bold;
154
+ }
155
+ .highlight .w {
156
+ color: #BBBBBB;
157
+ }
158
+ .highlight .go {
159
+ color: #BBBBBB;
160
+ }
161
+ .highlight .nf {
162
+ color: #a8e1fe;
163
+ }
164
+ .highlight .py {
165
+ color: #a8e1fe;
166
+ }
167
+ .highlight .na {
168
+ color: #a8e1fe;
169
+ }
170
+ .highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi {
171
+ color: #a8e1fe;
172
+ font-weight: bold;
173
+ }
@@ -1,7 +1,39 @@
1
- pre, code, .authentication form
1
+ html
2
2
  {
3
- font-family: monospace;
4
- border: 1px solid #e5e0c6;
3
+ -webkit-font-smoothing: antialiased;
4
+ text-rendering: optimizeLegibility;
5
+ }
6
+
7
+ body
8
+ {
9
+ margin: 0;
10
+ padding: 0;
11
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
12
+ }
13
+
14
+ a, a:active, a:visited, a:hover
15
+ {
16
+ color: #000000;
17
+ text-decoration: none;
18
+ font-weight: bold;
19
+ }
20
+
21
+ a:hover
22
+ {
23
+ text-decoration: underline;
24
+ }
25
+
26
+ .application, .page
27
+ {
28
+ margin: 10px auto;
29
+ width: 1024px;
30
+ }
31
+
32
+ p code
33
+ {
34
+ font-weight: bold;
35
+ font-style: italic;
36
+ font-family: inherit;
5
37
  }
6
38
 
7
39
  .authentication form
@@ -191,3 +223,22 @@ input[type=button], input[type=submit]
191
223
  padding: 10px;
192
224
  margin-bottom: 10px;
193
225
  }
226
+
227
+ div.highlight pre
228
+ {
229
+ margin: 0;
230
+ padding: 0;
231
+ }
232
+
233
+ div.highlight
234
+ {
235
+ padding: 10px;
236
+ margin-top: 5px;
237
+ margin-bottom: 5px;
238
+ border: 1px solid #e5e0c6;
239
+ }
240
+
241
+ .example div.highlight
242
+ {
243
+ padding: 5px;
244
+ }
@@ -1,12 +1,5 @@
1
1
  $(document).ready(function()
2
2
  {
3
- function highlight(selector)
4
- {
5
- selector.each(function(i, e) { hljs.highlightBlock(e); });
6
- }
7
-
8
- highlight($('code'));
9
-
10
3
  function compose_path(path)
11
4
  {
12
5
  return [window.location.pathname, path].join('/').replace(/\/\/+/, '/');
@@ -42,8 +35,6 @@ $(document).ready(function()
42
35
 
43
36
  form.find('.clear').removeClass('hidden');
44
37
 
45
- highlight(response.find('pre code'));
46
-
47
38
  enable_submit_buttons();
48
39
  }
49
40
 
@@ -1,5 +1,3 @@
1
1
  .example
2
2
  .label="#{example.label}:"
3
- %pre
4
- %code.bash
5
- = config.format_example.call(example, action, auth)
3
+ = highlighter.format(config.format_example.call(example, action, auth), :sh)
@@ -2,13 +2,12 @@
2
2
  %html
3
3
  %head
4
4
  %link{ rel: :stylesheet, href: theme_path, type: 'text/css' }
5
- %link{ rel: :stylesheet, href: asset_path('css/base.css'), type: 'text/css' }
6
- %link{ rel: :stylesheet, href: asset_path('css/application.css'), type: 'text/css' }
5
+ %link{ rel: :stylesheet, href: asset_path('css/styles.css'), type: 'text/css' }
7
6
  %script{ src: asset_path('js/jquery-1.12.3.min.js'), type: 'text/javascript' }
8
- %script{ src: asset_path('js/highlight.min.js'), type: 'text/javascript' }
9
7
  %script{ src: asset_path('js/application.js'), type: 'text/javascript' }
10
8
 
11
9
  %title= title
12
10
  %body
13
11
  .application
14
- = yield
12
+ = preserve do
13
+ = yield
@@ -1,7 +1,8 @@
1
1
  !!!
2
2
  %html
3
3
  %head
4
- %link{ rel: :stylesheet, href: asset_path('css/base.css'), type: 'text/css' }
4
+ %link{ rel: :stylesheet, href: theme_path, type: 'text/css' }
5
+ %link{ rel: :stylesheet, href: asset_path('css/styles.css'), type: 'text/css' }
5
6
 
6
7
  %title= title
7
8
  %body
@@ -10,4 +11,5 @@
10
11
  %h1=title
11
12
  %a{href: '/'}="< Back"
12
13
  .body
13
- = yield
14
+ = preserve do
15
+ = yield
@@ -3,17 +3,12 @@
3
3
  %input.clear.hidden{ type: 'button', value: 'Clear' }
4
4
  .response.hidden
5
5
  %p="Url:"
6
- %pre
7
- %code.url.http
6
+ .url
8
7
  %p="Query:"
9
- %pre
10
- %code.query.http
8
+ .query
11
9
  %p="Code:"
12
- %pre
13
- %code.code.http
10
+ .code
14
11
  %p="Headers:"
15
- %pre
16
- %code.headers.json
12
+ .headers
17
13
  %p="Body:"
18
- %pre
19
- %code.body.json
14
+ .body
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cabbage_doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mihail Szabolcs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-16 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 3.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 3.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: haml
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: sinatra
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 1.4.8
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 1.4.8
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httparty
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: json
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 1.8.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 1.8.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '10.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rouge
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 2.1.1
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 2.1.1
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: bundler
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -155,6 +169,8 @@ files:
155
169
  - lib/cabbage_doc/example.rb
156
170
  - lib/cabbage_doc/generator.rb
157
171
  - lib/cabbage_doc/generators/api.rb
172
+ - lib/cabbage_doc/highlighter.rb
173
+ - lib/cabbage_doc/markdown.rb
158
174
  - lib/cabbage_doc/parameter.rb
159
175
  - lib/cabbage_doc/params.rb
160
176
  - lib/cabbage_doc/parser.rb
@@ -168,45 +184,12 @@ files:
168
184
  - lib/cabbage_doc/web_helper.rb
169
185
  - lib/cabbage_doc/worker.rb
170
186
  - web/helpers/helper.rb
171
- - web/public/css/application.css
172
- - web/public/css/base.css
173
- - web/public/css/highlight/agate.css
174
- - web/public/css/highlight/androidstudio.css
175
- - web/public/css/highlight/arduino-light.css
176
- - web/public/css/highlight/arta.css
177
- - web/public/css/highlight/ascetic.css
178
- - web/public/css/highlight/codepen-embed.css
179
- - web/public/css/highlight/darkula.css
180
- - web/public/css/highlight/default.css
181
- - web/public/css/highlight/docco.css
182
- - web/public/css/highlight/dracula.css
183
- - web/public/css/highlight/foundation.css
184
- - web/public/css/highlight/github-gist.css
185
187
  - web/public/css/highlight/github.css
186
- - web/public/css/highlight/googlecode.css
187
- - web/public/css/highlight/grayscale.css
188
- - web/public/css/highlight/hybrid.css
189
- - web/public/css/highlight/idea.css
190
- - web/public/css/highlight/ir-black.css
191
- - web/public/css/highlight/magula.css
192
- - web/public/css/highlight/mono-blue.css
193
- - web/public/css/highlight/monokai-sublime.css
188
+ - web/public/css/highlight/molokai.css
194
189
  - web/public/css/highlight/monokai.css
195
- - web/public/css/highlight/obsidian.css
196
- - web/public/css/highlight/purebasic.css
197
- - web/public/css/highlight/qtcreator_dark.css
198
- - web/public/css/highlight/qtcreator_light.css
199
- - web/public/css/highlight/railscasts.css
200
- - web/public/css/highlight/rainbow.css
201
- - web/public/css/highlight/school-book.css
202
- - web/public/css/highlight/solarized-dark.css
203
- - web/public/css/highlight/solarized-light.css
204
- - web/public/css/highlight/sunburst.css
205
- - web/public/css/highlight/vs.css
206
- - web/public/css/highlight/xcode.css
207
- - web/public/css/highlight/zenburn.css
190
+ - web/public/css/highlight/thankful_eyes.css
191
+ - web/public/css/styles.css
208
192
  - web/public/js/application.js
209
- - web/public/js/highlight.min.js
210
193
  - web/public/js/jquery-1.12.3.min.js
211
194
  - web/views/action.haml
212
195
  - web/views/api.haml
@@ -244,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
227
  version: '0'
245
228
  requirements: []
246
229
  rubyforge_project:
247
- rubygems_version: 2.5.1
230
+ rubygems_version: 2.6.12
248
231
  signing_key:
249
232
  specification_version: 4
250
233
  summary: Interactive API documentation generator.